Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ESM version of Rollup #2705

Merged
merged 1 commit into from Feb 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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