Skip to content

Commit 5f6aa61

Browse files
committed
1.0.5
1 parent 1bceb74 commit 5f6aa61

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = function (babel) {
44
return {
55
visitor: {
66
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)) {
88
return;
99
}
1010
const requireExpression = t.callExpression(
@@ -61,7 +61,7 @@ module.exports = function (babel) {
6161
path.BABEL_PLUGIN_ADD_MODULE_REQUIRE = true;
6262
},
6363
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)) {
6565
return;
6666
}
6767
const requireExpression = t.callExpression(t.identifier('require'), [path.node.source]);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "babel-plugin-add-module-require",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"description": "A plugin like babel-plugin-add-module-exports and supports babel@7.",
55
"main": "index.js",
66
"license": "MIT",

0 commit comments

Comments
 (0)