Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Commit

Permalink
fix: remove colon from module prefixes (#371)
Browse files Browse the repository at this point in the history
When using Rollup with the `preserveModules` option set, it outputs all modules to files. External commonjs modules end up with a file name like `_commonjs-external:modulename`. Using a colon inside a file name is invalid and results in a lot of problems.
  • Loading branch information
Manduro authored and lukastaegert committed Apr 4, 2019
1 parent a34ebbc commit e63e57f
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/helpers.js
@@ -1,5 +1,5 @@
export const PROXY_PREFIX = '\0commonjs-proxy:';
export const EXTERNAL_PREFIX = '\0commonjs-external:';
export const PROXY_PREFIX = '\0commonjs-proxy-';
export const EXTERNAL_PREFIX = '\0commonjs-external-';
export const HELPERS_ID = '\0commonjsHelpers.js';

// `x['default']` is used instead of `x.default` for backward compatibility with ES3 browsers.
Expand Down
2 changes: 1 addition & 1 deletion test/form/constant-template-literal/output.js
@@ -1,5 +1,5 @@
import 'tape';
import foo from 'commonjs-proxy:tape';
import foo from 'commonjs-proxy-tape';

console.log(foo);

Expand Down
2 changes: 1 addition & 1 deletion test/form/ignore-ids-function/output.js
@@ -1,5 +1,5 @@
import 'bar';
import bar from 'commonjs-proxy:bar';
import bar from 'commonjs-proxy-bar';

var foo = require( 'foo' );

Expand Down
2 changes: 1 addition & 1 deletion test/form/ignore-ids/output.js
@@ -1,5 +1,5 @@
import 'bar';
import bar from 'commonjs-proxy:bar';
import bar from 'commonjs-proxy-bar';

var foo = require( 'foo' );

Expand Down
2 changes: 1 addition & 1 deletion test/form/multiple-var-declarations-b/output.js
@@ -1,5 +1,5 @@
import './a';
import a from 'commonjs-proxy:./a';
import a from 'commonjs-proxy-./a';

var b = 42;

Expand Down
2 changes: 1 addition & 1 deletion test/form/multiple-var-declarations-c/output.js
@@ -1,5 +1,5 @@
import './b';
import b from 'commonjs-proxy:./b';
import b from 'commonjs-proxy-./b';

var a = 'a'
, c = 'c';
Expand Down
4 changes: 2 additions & 2 deletions test/form/multiple-var-declarations/output.js
@@ -1,7 +1,7 @@
import './a';
import './b';
import require$$0 from 'commonjs-proxy:./a';
import b from 'commonjs-proxy:./b';
import require$$0 from 'commonjs-proxy-./a';
import b from 'commonjs-proxy-./b';

var a = require$$0();

Expand Down
2 changes: 1 addition & 1 deletion test/form/require-collision/output.js
@@ -1,5 +1,5 @@
import 'foo';
import require$$1 from 'commonjs-proxy:foo';
import require$$1 from 'commonjs-proxy-foo';

(function() {
var foo = require$$1;
Expand Down

0 comments on commit e63e57f

Please sign in to comment.