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

babel-plugin-name-amd-modules

Package Overview
Dependencies
Maintainers
13
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-name-amd-modules - npm Package Compare versions

Comparing version 2.19.4 to 2.20.0

6

package.json
{
"author": "Liferay Frontend Infrastructure Team <pt-frontend-infrastructure@liferay.com>",
"dependencies": {
"liferay-npm-build-tools-common": "2.19.4"
"liferay-npm-build-tools-common": "2.20.0"
},

@@ -19,4 +19,4 @@ "description": "A Babel plugin to give name to AMD modules based on their path and package.",

},
"version": "2.19.4",
"gitHead": "d341f385c91a7d50168a6ce8be978d2f03f6bedc"
"version": "2.20.0",
"gitHead": "c346146c8c8e6f7c12356f68dc7153efc6445e89"
}

@@ -58,20 +58,10 @@ # babel-plugin-name-amd-modules

This plugin scans modules for AMD `define()` calls and rewrites the module name
argument with one based on the name of the package that contains the module and
the module's relative path inside that package (removing the .js extension from
the file name too).
This plugin scans modules for AMD `define()` calls and rewrites the module name argument with one based on the name of the package that contains the module and the module's relative path inside that package (removing the .js extension from the file name too).
By default (if no custom value is given for the `packageName` option) this
plugin looks for the `package.json` of the module assuming it is located in a
JS Toolkit project. Otherwise, the package name can be forced to any fixed value
by providing a value other than `<package.json>` to the `packageName` option.
By default (if no custom value is given for the `packageName` option) this plugin looks for the `package.json` of the module assuming it is located in a JS Toolkit project. Otherwise, the package name can be forced to any fixed value by providing a value other than `<package.json>` to the `packageName` option.
To determine the relative path of the modules the `srcPrefixes` option is
examined and any folder found on it is removed from the path of the modules
being processed, giving the relative package name.
To determine the relative path of the modules the `srcPrefixes` option is examined and any folder found on it is removed from the path of the modules being processed, giving the relative package name.
For example, given a `srcPrefixes` of `["src"]` if the module under
`src/index.js` is processed, its relative path is transformed to `index.js`.
For example, given a `srcPrefixes` of `["src"]` if the module under `src/index.js` is processed, its relative path is transformed to `index.js`.
However, note that the plugin automatically removes `sources` configured inside
`.npmbundlerrc` when it transforms a file inside any of those folders.
However, note that the plugin automatically removes `sources` configured inside `.npmbundlerrc` when it transforms a file inside any of those folders.

@@ -70,3 +70,4 @@ /**

args.unshift(t.stringLiteral(moduleName));
} else {
}
else {
args[0].value = moduleName;

@@ -98,2 +99,3 @@ }

exit(path, state) {
// We must traverse the AST again because the

@@ -100,0 +102,0 @@ // transform-es2015-modules-amd plugin emits its define()

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