|
|
||||
|---|---|---|---|---|
| .. | ||||
| lib | 11e3a9652a | 7 years ago | ||
| .babelrc | 11e3a9652a | 7 years ago | ||
| .editorconfig | 11e3a9652a | 7 years ago | ||
| .eslintignore | 11e3a9652a | 7 years ago | ||
| .eslintrc | 11e3a9652a | 7 years ago | ||
| .travis.yml | 11e3a9652a | 7 years ago | ||
| CHANGELOG.md | 11e3a9652a | 7 years ago | ||
| LICENSE | 11e3a9652a | 7 years ago | ||
| README.md | 11e3a9652a | 7 years ago | ||
| package.json | 11e3a9652a | 7 years ago | ||
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']
});