babel-plugin-add-module-require
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -7,3 +7,3 @@ module.exports = function (babel) { | ||
CallExpression(path) { | ||
if (path.BABEL_PLUGIN_ADD_MODULE_REQUIRE || path.node.BABEL_PLUGIN_ADD_MODULE_REQUIRE || path.node.callee.name !== 'require' || !/^[\.\/]/.test(path.node.arguments[0].value)) { | ||
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)) { | ||
return; | ||
@@ -65,3 +65,3 @@ } | ||
ImportDeclaration(path) { | ||
if (path.BABEL_PLUGIN_ADD_MODULE_REQUIRE || !/^[\.\/]/.test(path.node.source.value)) { | ||
if (path.BABEL_PLUGIN_ADD_MODULE_REQUIRE || /^\w/.test(path.node.source.value)) { | ||
return; | ||
@@ -89,3 +89,3 @@ } | ||
'in', | ||
item.imported, | ||
t.stringLiteral(item.imported.name), | ||
requireExpression | ||
@@ -92,0 +92,0 @@ ), |
{ | ||
"name": "babel-plugin-add-module-require", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A plugin like babel-plugin-add-module-exports and supports babel@7.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4784