Skip to content

Commit

Permalink
build(rollup): Re-add rollup-plugin-cleanup with acorn dynamic import…
Browse files Browse the repository at this point in the history
… workaround

related aMarCruz/rollup-plugin-cleanup#13
  • Loading branch information
jcowman2 committed Dec 16, 2018
1 parent 0489a4a commit ed267d6
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 25 deletions.
28 changes: 21 additions & 7 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@
"@types/cosmiconfig": "^5.0.3",
"@types/filenamify": "^2.0.1",
"@types/mocha": "^5.2.5",
"acorn": "^6.0.4",
"acorn-dynamic-import": "^4.0.0",
"acorn-dynamic-import": "^3.0.0",
"chai": "^4.2.0",
"commitizen": "^3.0.5",
"coveralls": "^3.0.2",
"cz-conventional-changelog": "^2.1.0",
"mocha": "^5.2.0",
"nyc": "^13.1.0",
"prettier": "^1.15.3",
"rollup-plugin-cleanup": "^3.0.0",
"source-map-support": "^0.5.9",
"ts-node": "^7.0.1",
"tslint": "^5.11.0",
Expand Down
30 changes: 14 additions & 16 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import typescript from "rollup-plugin-typescript2";
// import cleanup from "rollup-plugin-cleanup";
import cleanup from "rollup-plugin-cleanup";
import json from "rollup-plugin-json";
// import acorn from "acorn";
// import inject from "acorn-dynamic-import/lib/walk";
import acorn from "acorn";
import inject from "acorn-dynamic-import/lib/inject";

import pkg from "./package.json";

Expand All @@ -27,7 +27,7 @@ const tsPlugin = typescript({
}
});

// inject(acorn);
inject(acorn);

export default [
{
Expand All @@ -40,18 +40,16 @@ export default [
plugins: [
tsPlugin,
json(),

/* TODO: Waiting on issue with rollup-plugin-cleanup */
// cleanup({
// extensions: [".js", ".ts"],
// comments: /^((?!(Joseph R Cowman)|tslint)[\s\S])*$/, // Removes file-header comments and tslint comments
// maxEmptyLines: 0,
// acornOptions: {
// plugins: {
// dynamicImport: true
// }
// }
// })
cleanup({
extensions: [".js", ".ts"],
comments: /^((?!(Joseph R Cowman)|tslint)[\s\S])*$/, // Removes file-header comments and tslint comments
maxEmptyLines: 0,
acornOptions: {
plugins: {
dynamicImport: true
}
}
})
],
onwarn: suppressCircularImportWarnings
}
Expand Down

0 comments on commit ed267d6

Please sign in to comment.