This commit is contained in:
2022-07-18 02:50:52 +00:00
parent befd344ab0
commit 06181b34d6
8569 changed files with 818704 additions and 352705 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
> This plugin transforms ES2015 modules to UMD
See our website [@babel/plugin-transform-modules-umd](https://babeljs.io/docs/en/next/babel-plugin-transform-modules-umd.html) for more information.
See our website [@babel/plugin-transform-modules-umd](https://babeljs.io/docs/en/babel-plugin-transform-modules-umd) for more information.
## Install
+17 -9
View File
@@ -37,16 +37,20 @@ const buildWrapper = (0, _core.template)(`
`);
var _default = (0, _helperPluginUtils.declare)((api, options) => {
var _api$assumption, _api$assumption2;
api.assertVersion(7);
const {
globals,
exactGlobals,
loose,
allowTopLevelThis,
strict,
strictMode,
noInterop
noInterop,
importInterop
} = options;
const constantReexports = (_api$assumption = api.assumption("constantReexports")) != null ? _api$assumption : options.loose;
const enumerableModuleMeta = (_api$assumption2 = api.assumption("enumerableModuleMeta")) != null ? _api$assumption2 : options.loose;
function buildBrowserInit(browserGlobals, exactGlobals, filename, moduleName) {
const moduleNameOrBasename = moduleName ? moduleName.value : (0, _path.basename)(filename, (0, _path.extname)(filename));
@@ -101,17 +105,21 @@ var _default = (0, _helperPluginUtils.declare)((api, options) => {
exit(path) {
if (!(0, _helperModuleTransforms.isModule)(path)) return;
const browserGlobals = globals || {};
let moduleName = (0, _helperModuleTransforms.getModuleName)(this.file.opts, options);
if (moduleName) moduleName = _core.types.stringLiteral(moduleName);
const moduleName = (0, _helperModuleTransforms.getModuleName)(this.file.opts, options);
let moduleNameLiteral;
if (moduleName) moduleNameLiteral = _core.types.stringLiteral(moduleName);
const {
meta,
headers
} = (0, _helperModuleTransforms.rewriteModuleStatementsAndPrepareHeader)(path, {
loose,
constantReexports,
enumerableModuleMeta,
strict,
strictMode,
allowTopLevelThis,
noInterop
noInterop,
importInterop,
filename: this.file.opts.filename
});
const amdArgs = [];
const commonjsArgs = [];
@@ -142,7 +150,7 @@ var _default = (0, _helperPluginUtils.declare)((api, options) => {
}
}
headers.push(...(0, _helperModuleTransforms.buildNamespaceInitStatements)(meta, metadata, loose));
headers.push(...(0, _helperModuleTransforms.buildNamespaceInitStatements)(meta, metadata, constantReexports));
}
(0, _helperModuleTransforms.ensureStatementsHoisted)(headers);
@@ -154,12 +162,12 @@ var _default = (0, _helperPluginUtils.declare)((api, options) => {
path.node.directives = [];
path.node.body = [];
const umdWrapper = path.pushContainer("body", [buildWrapper({
MODULE_NAME: moduleName,
MODULE_NAME: moduleNameLiteral,
AMD_ARGUMENTS: _core.types.arrayExpression(amdArgs),
COMMONJS_ARGUMENTS: commonjsArgs,
BROWSER_ARGUMENTS: browserArgs,
IMPORT_NAMES: importNames,
GLOBAL_TO_ASSIGN: buildBrowserInit(browserGlobals, exactGlobals, this.filename || "unknown", moduleName)
GLOBAL_TO_ASSIGN: buildBrowserInit(browserGlobals, exactGlobals, this.filename || "unknown", moduleNameLiteral)
})])[0];
const umdFactory = umdWrapper.get("expression.arguments")[1].get("body");
umdFactory.pushContainer("directives", directives);
+27 -19
View File
@@ -1,52 +1,59 @@
{
"_args": [
[
"@babel/plugin-transform-modules-umd@7.10.4",
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
"@babel/plugin-transform-modules-umd@7.18.6",
"/home/node/nuxt"
]
],
"_from": "@babel/plugin-transform-modules-umd@7.10.4",
"_id": "@babel/plugin-transform-modules-umd@7.10.4",
"_from": "@babel/plugin-transform-modules-umd@7.18.6",
"_id": "@babel/plugin-transform-modules-umd@7.18.6",
"_inBundle": false,
"_integrity": "sha512-mohW5q3uAEt8T45YT7Qc5ws6mWgJAaL/8BfWD9Dodo1A3RKWli8wTS+WiQ/knF+tXlPirW/1/MqzzGfCExKECA==",
"_integrity": "sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ==",
"_location": "/@babel/plugin-transform-modules-umd",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@babel/plugin-transform-modules-umd@7.10.4",
"raw": "@babel/plugin-transform-modules-umd@7.18.6",
"name": "@babel/plugin-transform-modules-umd",
"escapedName": "@babel%2fplugin-transform-modules-umd",
"scope": "@babel",
"rawSpec": "7.10.4",
"rawSpec": "7.18.6",
"saveSpec": null,
"fetchSpec": "7.10.4"
"fetchSpec": "7.18.6"
},
"_requiredBy": [
"/@babel/preset-env"
],
"_resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.10.4.tgz",
"_spec": "7.10.4",
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
"_resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.18.6.tgz",
"_spec": "7.18.6",
"_where": "/home/node/nuxt",
"author": {
"name": "The Babel Team",
"url": "https://babel.dev/team"
},
"bugs": {
"url": "https://github.com/babel/babel/issues"
},
"dependencies": {
"@babel/helper-module-transforms": "^7.10.4",
"@babel/helper-plugin-utils": "^7.10.4"
"@babel/helper-module-transforms": "^7.18.6",
"@babel/helper-plugin-utils": "^7.18.6"
},
"description": "This plugin transforms ES2015 modules to UMD",
"devDependencies": {
"@babel/core": "^7.10.4",
"@babel/helper-plugin-test-runner": "^7.10.4"
"@babel/core": "^7.18.6",
"@babel/helper-plugin-test-runner": "^7.18.6",
"@babel/plugin-external-helpers": "^7.18.6"
},
"gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df",
"homepage": "https://github.com/babel/babel#readme",
"engines": {
"node": ">=6.9.0"
},
"homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-modules-umd",
"keywords": [
"babel-plugin"
],
"license": "MIT",
"main": "lib/index.js",
"main": "./lib/index.js",
"name": "@babel/plugin-transform-modules-umd",
"peerDependencies": {
"@babel/core": "^7.0.0-0"
@@ -59,5 +66,6 @@
"url": "git+https://github.com/babel/babel.git",
"directory": "packages/babel-plugin-transform-modules-umd"
},
"version": "7.10.4"
"type": "commonjs",
"version": "7.18.6"
}