Skip to content

Commit

Permalink
Fix ESM version of Rollup (#2705)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Feb 17, 2019
1 parent 60e8df2 commit 8dbf347
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -96,7 +96,7 @@
"pretty-ms": "^4.0.0",
"remap-istanbul": "^0.13.0",
"require-relative": "^0.8.7",
"rollup": "^1.1.2",
"rollup": "^1.2.0",
"rollup-plugin-alias": "^1.5.1",
"rollup-plugin-buble": "^0.19.6",
"rollup-plugin-commonjs": "^9.2.0",
Expand Down
6 changes: 3 additions & 3 deletions rollup.config.js
Expand Up @@ -40,9 +40,9 @@ const onwarn = warning => {
throw new Error(warning.message);
};

const expectedAcornImport = /import acorn__default, { tokTypes, Parser( as [\w$]+)? } from 'acorn';/;
const expectedAcornImport = "import acorn__default, { tokTypes, Parser as Parser$1 } from 'acorn';";
const newAcornImport =
"import * as acorn__default from 'acorn';\nimport { tokTypes, Parser } from 'acorn';";
"import * as acorn__default from 'acorn';\nimport { tokTypes, Parser as Parser$1 } from 'acorn';";

// by default, rollup-plugin-commonjs will translate require statements as default imports
// which can cause issues for secondary tools that use the ESM version of acorn
Expand Down Expand Up @@ -85,7 +85,7 @@ export default command => {
resolve(),
json(),
typescript(),
commonjs({ include: 'node_modules/**', namedExports: { micromatch: ['matcher' ] } }),
commonjs({ include: 'node_modules/**', namedExports: { micromatch: ['matcher'] } }),
fixAcornEsmImport()
],
// acorn needs to be external as some plugins rely on a shared acorn instance
Expand Down

0 comments on commit 8dbf347

Please sign in to comment.