File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ module.exports = function (babel) {
4
4
return {
5
5
visitor : {
6
6
CallExpression ( path ) {
7
- if ( path . BABEL_PLUGIN_ADD_MODULE_REQUIRE || path . node . BABEL_PLUGIN_ADD_MODULE_REQUIRE || path . node . callee . name !== 'require' || / ^ \w / . test ( path . node . arguments [ 0 ] . value ) ) {
7
+ if ( path . BABEL_PLUGIN_ADD_MODULE_REQUIRE || path . node . BABEL_PLUGIN_ADD_MODULE_REQUIRE || path . node . callee . name !== 'require' || / ^ [ \w @ ] / . test ( path . node . arguments [ 0 ] . value ) ) {
8
8
return ;
9
9
}
10
10
const requireExpression = t . callExpression (
@@ -61,7 +61,7 @@ module.exports = function (babel) {
61
61
path . BABEL_PLUGIN_ADD_MODULE_REQUIRE = true ;
62
62
} ,
63
63
ImportDeclaration ( path ) {
64
- if ( path . BABEL_PLUGIN_ADD_MODULE_REQUIRE || / ^ \w / . test ( path . node . source . value ) ) {
64
+ if ( path . BABEL_PLUGIN_ADD_MODULE_REQUIRE || / ^ [ \w @ ] / . test ( path . node . source . value ) ) {
65
65
return ;
66
66
}
67
67
const requireExpression = t . callExpression ( t . identifier ( 'require' ) , [ path . node . source ] ) ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " babel-plugin-add-module-require" ,
3
- "version" : " 1.0.3 " ,
3
+ "version" : " 1.0.4 " ,
4
4
"description" : " A plugin like babel-plugin-add-module-exports and supports babel@7." ,
5
5
"main" : " index.js" ,
6
6
"license" : " MIT" ,
You can’t perform that action at this time.
0 commit comments