|
||||
---|---|---|---|---|
.. | ||||
lib | 11e3a9652a | 7 年之前 | ||
.babelrc | 11e3a9652a | 7 年之前 | ||
.editorconfig | 11e3a9652a | 7 年之前 | ||
.eslintignore | 11e3a9652a | 7 年之前 | ||
.eslintrc | 11e3a9652a | 7 年之前 | ||
.travis.yml | 11e3a9652a | 7 年之前 | ||
CHANGELOG.md | 11e3a9652a | 7 年之前 | ||
LICENSE | 11e3a9652a | 7 年之前 | ||
README.md | 11e3a9652a | 7 年之前 | ||
package.json | 11e3a9652a | 7 年之前 |
Babel plugin to transpile import()
to a deferred require()
, for node. Matches the proposed spec.
NOTE: Babylon >= v6.12.0 is required to correct parse dynamic imports.
$ npm install babel-plugin-dynamic-import-node --save-dev
.babelrc
(Recommended).babelrc
{
"plugins": ["dynamic-import-node"]
}
$ babel --plugins dynamic-import-node script.js
require('babel-core').transform('code', {
plugins: ['dynamic-import-node']
});