babel-plugin-transform-cjs-system-require
Advanced tools
Comparing version 0.0.2 to 0.1.0
@@ -52,5 +52,2 @@ 'use strict'; | ||
// require(expr)'; | ||
else { | ||
path.replaceWith(t.callExpression(t.identifier(mappedRequireName), args)); | ||
} | ||
} | ||
@@ -61,2 +58,7 @@ }, | ||
var opts = _ref3$opts === undefined ? {} : _ref3$opts; | ||
if (t.isObjectProperty(path.parent) || t.isMemberExpression(path.parent)) { | ||
return; | ||
} | ||
var _opts$requireName2 = opts.requireName; | ||
@@ -69,3 +71,3 @@ var requireName = _opts$requireName2 === undefined ? 'require' : _opts$requireName2; | ||
if (path.node.name === requireName) { | ||
path.node.name = mappedRequireName; | ||
path.replaceWith(t.identifier(mappedRequireName)); | ||
} | ||
@@ -72,0 +74,0 @@ } |
{ | ||
"name": "babel-plugin-transform-cjs-system-require", | ||
"version": "0.0.2", | ||
"version": "0.1.0", | ||
"description": "Transforms all calls of `require` into calls of the SystemJS internal `$__require`.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -0,0 +0,0 @@ # babel-plugin-transform-cjs-system-require |
@@ -0,0 +0,0 @@ module.exports = { |
module.exports = { | ||
mappedRequireName : '$__foo' | ||
}; |
module.exports = { | ||
requireName : 'foo' | ||
}; |
@@ -0,0 +0,0 @@ import path from 'path'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
9515
24
184
4