[import()] Initial support for dynamic-import (#4699)
* [import()] Initial support for function-like import * [import()] Renaming import-functions to dynamic-import * [stage-2] Fixing lint error * add to package.json
This commit is contained in:
committed by
Henry Zhu
parent
b8eeddf960
commit
391e5bd813
35
packages/babel-plugin-syntax-dynamic-import/README.md
Normal file
35
packages/babel-plugin-syntax-dynamic-import/README.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# babel-plugin-syntax-dynamic-import
|
||||
|
||||
Allow parsing of `import()`.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
$ npm install babel-plugin-syntax-dynamic-import
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Via `.babelrc` (Recommended)
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["syntax-dynamic-import"]
|
||||
}
|
||||
```
|
||||
|
||||
### Via CLI
|
||||
|
||||
```sh
|
||||
$ babel --plugins syntax-dynamic-import script.js
|
||||
```
|
||||
|
||||
### Via Node API
|
||||
|
||||
```javascript
|
||||
require("babel-core").transform("code", {
|
||||
plugins: ["syntax-dynamic-import"]
|
||||
});
|
||||
```
|
||||
Reference in New Issue
Block a user