babel-plugin-name-amd-modules
Advanced tools
Comparing version 2.19.4 to 2.20.0
{ | ||
"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() |
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
13779
343
67
+ Addedbabel-plugin-add-module-metadata@2.20.0(transitive)
+ Addedbabel-plugin-alias-modules@2.20.0(transitive)
+ Addedbabel-plugin-namespace-amd-define@2.20.0(transitive)
+ Addedbabel-plugin-namespace-modules@2.20.0(transitive)
+ Addedbabel-plugin-normalize-requires@2.20.0(transitive)
+ Addedbabel-plugin-wrap-modules-amd@2.20.0(transitive)
+ Addedbabel-preset-liferay-standard@2.20.0(transitive)
+ Addedliferay-npm-build-tools-common@2.20.0(transitive)
+ Addedliferay-npm-bundler-plugin-exclude-imports@2.20.0(transitive)
+ Addedliferay-npm-bundler-plugin-inject-imports-dependencies@2.20.0(transitive)
+ Addedliferay-npm-bundler-plugin-inject-peer-dependencies@2.20.0(transitive)
+ Addedliferay-npm-bundler-plugin-namespace-packages@2.20.0(transitive)
+ Addedliferay-npm-bundler-plugin-replace-browser-modules@2.20.0(transitive)
+ Addedliferay-npm-bundler-plugin-resolve-linked-dependencies@2.20.0(transitive)
+ Addedliferay-npm-bundler-preset-standard@2.20.0(transitive)
- Removedbabel-plugin-add-module-metadata@2.19.4(transitive)
- Removedbabel-plugin-alias-modules@2.19.4(transitive)
- Removedbabel-plugin-namespace-amd-define@2.19.4(transitive)
- Removedbabel-plugin-namespace-modules@2.19.4(transitive)
- Removedbabel-plugin-normalize-requires@2.19.4(transitive)
- Removedbabel-plugin-wrap-modules-amd@2.19.4(transitive)
- Removedbabel-preset-liferay-standard@2.19.4(transitive)
- Removedliferay-npm-build-tools-common@2.19.4(transitive)
- Removedliferay-npm-bundler-plugin-exclude-imports@2.19.4(transitive)
- Removedliferay-npm-bundler-plugin-inject-imports-dependencies@2.19.4(transitive)
- Removedliferay-npm-bundler-plugin-inject-peer-dependencies@2.19.4(transitive)
- Removedliferay-npm-bundler-plugin-namespace-packages@2.19.4(transitive)
- Removedliferay-npm-bundler-plugin-replace-browser-modules@2.19.4(transitive)
- Removedliferay-npm-bundler-plugin-resolve-linked-dependencies@2.19.4(transitive)
- Removedliferay-npm-bundler-preset-standard@2.19.4(transitive)