Skip to content

Commit

Permalink
[Refactor] remove dependency on babel-plugin-syntax-dynamic-import
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Oct 8, 2018
1 parent 964b730 commit 8b4d260
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"tape": "^4.9.1"
},
"dependencies": {
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"object.assign": "^4.1.0"
}
}
9 changes: 6 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import syntax from 'babel-plugin-syntax-dynamic-import';

export default function ({ template, types: t }) {
const buildImport = template('Promise.resolve().then(() => MODULE)');

return {
inherits: syntax,
// NOTE: Once we drop support for Babel <= v6 we should
// update this to import from @babel/plugin-syntax-dynamic-import.
// https://www.npmjs.com/package/@babel/plugin-syntax-dynamic-import
manipulateOptions(opts, parserOpts) {
parserOpts.plugins.push('dynamicImport');
},

visitor: {
Import(path) {
Expand Down

0 comments on commit 8b4d260

Please sign in to comment.