Syntax Dynamic Import

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.

Installation

npm install --save-dev babel-plugin-syntax-dynamic-import

Usage

.babelrc

{
  "plugins": ["syntax-dynamic-import"]
}

Via CLI

babel --plugins syntax-dynamic-import script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["syntax-dynamic-import"]
});