Allow parsing of import()
Syntax only
This plugin only allows Babel to parse this syntax. If you want to transform it then see dynamic-import-webpack or dynamic-import-node.
npm install --save-dev babel-plugin-syntax-dynamic-import
.babelrc
(Recommended).babelrc
{ "plugins": ["syntax-dynamic-import"] }
babel --plugins syntax-dynamic-import script.js
require("babel-core").transform("code", { plugins: ["syntax-dynamic-import"] });
© 2018 Sebastian McKenzie
Licensed under the MIT License.
http://babeljs.io/docs/plugins/syntax-dynamic-import/