diff --git a/package.json b/package.json index e940e77..ebdfdd8 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,6 @@ "tape": "^4.9.1" }, "dependencies": { - "babel-plugin-syntax-dynamic-import": "^6.18.0", "object.assign": "^4.1.0" } } diff --git a/src/index.js b/src/index.js index 0fd4ef0..37770a6 100644 --- a/src/index.js +++ b/src/index.js @@ -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) {