Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-module-rewrite

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-module-rewrite - npm Package Compare versions

Comparing version 0.1.2 to 0.2.0

11

lib/index.js

@@ -66,3 +66,3 @@ 'use strict';

function transformImportCall(nodePath, state) {
function transformImportExportCall(nodePath, state) {
var moduleArg = nodePath.node.source;

@@ -72,3 +72,3 @@ if (moduleArg && moduleArg.type === 'StringLiteral') {

if (modulePath) {
nodePath.replaceWith(t.importDeclaration(nodePath.node.specifiers, t.stringLiteral(modulePath)));
nodePath.node.source = t.stringLiteral(modulePath);
}

@@ -87,4 +87,9 @@ }

exit: function exit(nodePath, state) {
return transformImportCall(nodePath, state);
return transformImportExportCall(nodePath, state);
}
},
ExportDeclaration: {
exit: function exit(nodePath, state) {
return transformImportExportCall(nodePath, state);
}
}

@@ -91,0 +96,0 @@ }

{
"name": "babel-plugin-module-rewrite",
"version": "0.1.2",
"version": "0.2.0",
"main": "lib/index.js",

@@ -5,0 +5,0 @@ "description": "Babel plugin to dynamically rewrite the path in require() and ES6 import",

@@ -35,3 +35,3 @@ # babel-plugin-module-rewrite

} else {
return originalPath. replace('~', 'common');
return originalPath.replace('~', 'common');
}

@@ -38,0 +38,0 @@ }

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc