File tree 4 files changed +6
-11
lines changed
4 files changed +6
-11
lines changed Original file line number Diff line number Diff line change 1
1
src /
2
2
test /
3
+ .idea
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ I am using it for server-side rendering.
8
8
9
9
** babel-plugin-dynamic-import-node-sync**
10
10
```
11
- import(SOURCE) => require(SOURCE)
11
+ import(SOURCE) => () => { const r= require(SOURCE);r.then(cb=>cb(r));return r; }( )
12
12
```
13
13
14
14
** babel-plugin-dynamic-import-node**
@@ -19,7 +19,7 @@ import(SOURCE) => Promise.resolve().then(() => require(SOURCE))
19
19
## Installation
20
20
21
21
``` sh
22
- $ npm install babel-plugin-dynamic-import-node-sync --save-dev
22
+ $ npm install @ridestore/ babel-plugin-dynamic-import-node-sync --save-dev
23
23
```
24
24
25
25
## Usage
@@ -30,12 +30,6 @@ $ npm install babel-plugin-dynamic-import-node-sync --save-dev
30
30
31
31
``` json
32
32
{
33
- "plugins" : [" dynamic-import-node-sync" ]
33
+ "plugins" : [" @ridestore/babel-plugin- dynamic-import-node-sync" ]
34
34
}
35
35
```
36
-
37
- ### Via CLI
38
-
39
- ``` sh
40
- $ babel --plugins dynamic-import-node-sync script.js
41
- ```
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " babel-plugin-dynamic-import-node-sync" ,
2
+ "name" : " @ridestore/ babel-plugin-dynamic-import-node-sync" ,
3
3
"version" : " 1.0.1" ,
4
4
"description" : " Babel 6 plugin to transpile import() to a require(), for node" ,
5
5
"main" : " lib/index.js" ,
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export default () => ({
14
14
CallExpression ( path ) {
15
15
if ( path . node . callee . type === TYPE_IMPORT ) {
16
16
const importArgument = path . node . arguments [ 0 ] ;
17
- const [ , syncComment ] = importArgument ;
17
+ const syncComment = importArgument [ 1 ] ;
18
18
19
19
if ( ! syncComment || ! syncComment . value || ! ( syncComment . value . trim ( ) . toLowerCase ( ) === 'sync' ) ) {
20
20
return ;
You can’t perform that action at this time.
0 commit comments