@umijs/bundler-webpack 4.0.0-beta.8 → 4.0.0-canary-20240513.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/client/client.js +255 -167
- package/client/constants.d.ts +15 -0
- package/client/constants.js +30 -12
- package/client/utils/formatWebpackMessages.d.ts +12 -0
- package/client/utils/formatWebpackMessages.js +87 -86
- package/compiled/autoprefixer/browserslist/index.d.ts +33 -7
- package/compiled/autoprefixer/index.js +3 -3
- package/compiled/autoprefixer/package.json +1 -1
- package/compiled/autoprefixer/postcss/lib/at-rule.d.ts +1 -1
- package/compiled/autoprefixer/postcss/lib/comment.d.ts +1 -1
- package/compiled/autoprefixer/postcss/lib/container.d.ts +2 -2
- package/compiled/autoprefixer/postcss/lib/css-syntax-error.d.ts +55 -8
- package/compiled/autoprefixer/postcss/lib/declaration.d.ts +2 -2
- package/compiled/autoprefixer/postcss/lib/input.d.ts +26 -6
- package/compiled/autoprefixer/postcss/lib/lazy-result.d.ts +11 -10
- package/compiled/autoprefixer/postcss/lib/no-work-result.d.ts +37 -0
- package/compiled/autoprefixer/postcss/lib/node.d.ts +38 -4
- package/compiled/autoprefixer/postcss/lib/postcss.d.ts +31 -30
- package/compiled/autoprefixer/postcss/lib/processor.d.ts +6 -5
- package/compiled/autoprefixer/postcss/lib/result.d.ts +3 -2
- package/compiled/autoprefixer/postcss/lib/rule.d.ts +1 -1
- package/compiled/autoprefixer/postcss/lib/warning.d.ts +37 -3
- package/compiled/autoprefixer/source-map-js/source-map.d.ts +99 -82
- package/compiled/babel-loader/index.js +8 -2
- package/compiled/babel-loader/package.json +1 -1
- package/compiled/copy-webpack-plugin/939.index.js +1171 -0
- package/compiled/copy-webpack-plugin/index.js +16 -10
- package/compiled/copy-webpack-plugin/package.json +1 -1
- package/compiled/css-minimizer-webpack-plugin/index.js +8 -2
- package/compiled/css-minimizer-webpack-plugin/minify.js +23 -22
- package/compiled/css-minimizer-webpack-plugin/package.json +1 -1
- package/compiled/css-minimizer-webpack-plugin/utils.js +305 -54
- package/compiled/cssnano/index.js +12 -11
- package/compiled/cssnano/package.json +1 -1
- package/compiled/express.d.ts +2 -0
- package/compiled/file-loader/index.js +3 -0
- package/compiled/file-loader/package.json +1 -0
- package/compiled/less-loader/index.js +1 -1
- package/compiled/less-loader/package.json +1 -1
- package/compiled/mini-css-extract-plugin/hmr/hotModuleReplacement.js +60 -46
- package/compiled/mini-css-extract-plugin/hmr/normalize-url.js +10 -6
- package/compiled/mini-css-extract-plugin/index.js +10669 -10348
- package/compiled/mini-css-extract-plugin/loader.js +159 -100
- package/compiled/mini-css-extract-plugin/package.json +1 -1
- package/compiled/mini-css-extract-plugin/utils.js +88 -44
- package/compiled/postcss-loader/index.js +1 -1
- package/compiled/postcss-loader/package.json +1 -1
- package/compiled/sass-loader/index.js +1 -1
- package/compiled/sass-loader/package.json +1 -1
- package/compiled/sass-loader/sass.default.dart.js +4 -0
- package/compiled/schema-utils/ajv/dist/ajv.d.ts +16 -0
- package/compiled/schema-utils/ajv/dist/compile/codegen/code.d.ts +39 -0
- package/compiled/schema-utils/ajv/dist/compile/codegen/index.d.ts +79 -0
- package/compiled/schema-utils/ajv/dist/compile/codegen/scope.d.ts +79 -0
- package/compiled/schema-utils/ajv/dist/compile/errors.d.ts +13 -0
- package/compiled/schema-utils/ajv/dist/compile/index.d.ts +80 -0
- package/compiled/schema-utils/ajv/dist/compile/ref_error.d.ts +5 -0
- package/compiled/schema-utils/ajv/dist/compile/resolve.d.ts +12 -0
- package/compiled/schema-utils/ajv/dist/compile/rules.d.ts +28 -0
- package/compiled/schema-utils/ajv/dist/compile/util.d.ts +40 -0
- package/compiled/schema-utils/ajv/dist/compile/validate/index.d.ts +42 -0
- package/compiled/schema-utils/ajv/dist/compile/validate/subschema.d.ts +47 -0
- package/compiled/schema-utils/ajv/dist/core.d.ts +171 -0
- package/compiled/schema-utils/ajv/dist/runtime/validation_error.d.ts +7 -0
- package/compiled/schema-utils/ajv/dist/types/index.d.ts +177 -0
- package/compiled/schema-utils/ajv/dist/types/json-schema.d.ts +124 -0
- package/compiled/schema-utils/ajv/dist/types/jtd-schema.d.ts +168 -0
- package/compiled/schema-utils/declarations/validate.d.ts +4 -4
- package/compiled/schema-utils/index.js +8 -2
- package/compiled/schema-utils/uri-js/dist/es5/uri.all.d.ts +59 -0
- package/compiled/style-loader/index.js +1 -1
- package/compiled/stylus-loader/LICENSE +20 -0
- package/compiled/stylus-loader/index.js +44 -0
- package/compiled/stylus-loader/package.json +1 -0
- package/compiled/terser/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts +90 -0
- package/compiled/terser/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts +12 -0
- package/compiled/terser/@jridgewell/gen-mapping/dist/types/types.d.ts +35 -0
- package/compiled/terser/@jridgewell/source-map/dist/types/source-map.d.ts +25 -0
- package/compiled/terser/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts +16 -0
- package/compiled/terser/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts +74 -0
- package/compiled/terser/@jridgewell/trace-mapping/dist/types/types.d.ts +92 -0
- package/compiled/terser/index.js +1 -1
- package/compiled/terser/package.json +1 -1
- package/compiled/terser/tools/terser.d.ts +6 -3
- package/compiled/terser-webpack-plugin/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts +16 -0
- package/compiled/terser-webpack-plugin/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts +74 -0
- package/compiled/terser-webpack-plugin/@jridgewell/trace-mapping/dist/types/types.d.ts +92 -0
- package/compiled/terser-webpack-plugin/index.js +1390 -3693
- package/compiled/terser-webpack-plugin/jest-worker/build/types.d.ts +1 -0
- package/compiled/terser-webpack-plugin/minify.js +10 -3
- package/compiled/terser-webpack-plugin/package.json +1 -1
- package/compiled/terser-webpack-plugin/types/index.d.ts +186 -152
- package/compiled/terser-webpack-plugin/types/minify.d.ts +17 -0
- package/compiled/terser-webpack-plugin/types/utils.d.ts +20 -24
- package/compiled/terser-webpack-plugin/utils.js +153 -34
- package/compiled/webpack/BasicEffectRulePlugin.js +1 -0
- package/compiled/webpack/BasicEvaluatedExpression.js +1 -0
- package/compiled/webpack/BasicMatcherRulePlugin.js +1 -0
- package/compiled/webpack/ExternalsPlugin.js +1 -0
- package/compiled/webpack/FetchCompileAsyncWasmPlugin.js +1 -0
- package/compiled/webpack/FetchCompileWasmPlugin.js +1 -0
- package/compiled/webpack/HotModuleReplacement.runtime.js +29 -14
- package/compiled/webpack/JavascriptHotModuleReplacement.runtime.js +4 -3
- package/compiled/webpack/LimitChunkCountPlugin.js +1 -0
- package/compiled/webpack/NodeTargetPlugin.js +1 -0
- package/compiled/webpack/NodeTemplatePlugin.js +1 -0
- package/compiled/webpack/ObjectMatcherRulePlugin.js +1 -0
- package/compiled/webpack/RuleSetCompiler.js +1 -0
- package/compiled/webpack/StringXor.js +1 -0
- package/compiled/webpack/UseEffectRulePlugin.js +1 -0
- package/compiled/webpack/WebWorkerTemplatePlugin.js +1 -0
- package/compiled/webpack/deepImports.json +15 -1
- package/compiled/webpack/index.js +26404 -10329
- package/compiled/webpack/json-schema/index.d.ts +8 -1
- package/compiled/webpack/lazy-compilation-node.js +10 -0
- package/compiled/webpack/lazy-compilation-web.js +9 -0
- package/compiled/webpack/types.d.ts +823 -287
- package/compiled/webpack-5-chain/index.js +1 -1
- package/compiled/webpack-5-chain/package.json +1 -1
- package/compiled/webpack-5-chain/types/index.d.ts +76 -20
- package/compiled/webpack-bundle-analyzer/index.js +7 -6
- package/compiled/webpack-bundle-analyzer/package.json +1 -1
- package/compiled/webpack-bundle-analyzer/public/viewer.js +2 -2
- package/compiled/webpack-bundle-analyzer/public/viewer.js.map +1 -1
- package/compiled/webpack-dev-middleware/index.js +12 -5
- package/compiled/webpack-dev-middleware/package.json +1 -1
- package/compiled/{tapable → webpack-manifest-plugin}/LICENSE +2 -2
- package/compiled/webpack-manifest-plugin/index.js +1 -0
- package/compiled/webpack-manifest-plugin/package.json +1 -0
- package/compiled/webpack-sources/index.js +1 -1
- package/compiled/{express → webpackbar}/LICENSE +1 -5
- package/compiled/webpackbar/dist/index.d.ts +121 -0
- package/compiled/webpackbar/index.js +7 -0
- package/compiled/webpackbar/package.json +1 -0
- package/compiled/ws/LICENSE +13 -12
- package/compiled/ws/index.d.ts +74 -35
- package/compiled/ws/index.js +1 -1
- package/compiled/ws/package.json +1 -1
- package/dist/build.d.ts +8 -3
- package/dist/build.js +147 -68
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +84 -81
- package/dist/config/_sampleFeature.js +33 -20
- package/dist/config/assetRules.js +46 -55
- package/dist/config/bundleAnalyzerPlugin.js +41 -28
- package/dist/config/compressPlugin.js +125 -74
- package/dist/config/config.d.ts +11 -2
- package/dist/config/config.js +235 -172
- package/dist/config/copyPlugin.js +61 -47
- package/dist/config/cssRules.js +162 -95
- package/dist/config/definePlugin.d.ts +2 -0
- package/dist/config/definePlugin.js +59 -39
- package/dist/config/detectCssModulesInDependence.d.ts +10 -0
- package/dist/config/detectCssModulesInDependence.js +151 -0
- package/dist/config/detectDeadCode.d.ts +12 -0
- package/dist/config/detectDeadCode.js +191 -0
- package/dist/config/detectDeadCodePlugin.d.ts +9 -0
- package/dist/config/detectDeadCodePlugin.js +82 -0
- package/dist/config/fastRefreshPlugin.js +46 -31
- package/dist/config/forkTSCheckerPlugin.d.ts +11 -0
- package/dist/config/forkTSCheckerPlugin.js +49 -0
- package/dist/config/harmonyLinkingErrorPlugin.d.ts +6 -0
- package/dist/config/harmonyLinkingErrorPlugin.js +53 -0
- package/dist/config/ignorePlugin.js +38 -25
- package/dist/config/javaScriptRules.d.ts +2 -0
- package/dist/config/javaScriptRules.js +186 -150
- package/dist/config/manifestPlugin.d.ts +11 -0
- package/dist/config/manifestPlugin.js +40 -0
- package/dist/config/miniCSSExtractPlugin.d.ts +1 -0
- package/dist/config/miniCSSExtractPlugin.js +52 -31
- package/dist/config/nodePolyfill.js +49 -32
- package/dist/config/nodePrefixPlugin.d.ts +11 -0
- package/dist/config/nodePrefixPlugin.js +38 -0
- package/dist/config/progressPlugin.js +50 -24
- package/dist/config/purgecssWebpackPlugin.js +41 -30
- package/dist/config/speedMeasureWebpackPlugin.js +56 -31
- package/dist/config/ssrPlugin.d.ts +11 -0
- package/dist/config/ssrPlugin.js +98 -0
- package/dist/config/svgRules.d.ts +1 -0
- package/dist/config/svgRules.js +68 -54
- package/dist/constants.d.ts +4 -0
- package/dist/constants.js +59 -15
- package/dist/dev.d.ts +23 -3
- package/dist/dev.js +198 -81
- package/dist/index.d.ts +6 -2
- package/dist/index.js +31 -15
- package/dist/loader/svgr.d.ts +4 -0
- package/dist/loader/svgr.js +84 -0
- package/dist/loader/swc.d.ts +4 -0
- package/dist/loader/swc.js +149 -0
- package/dist/parcelCSS.d.ts +2 -0
- package/dist/parcelCSS.js +39 -0
- package/dist/plugins/EsbuildMinifyFix.d.ts +8 -0
- package/dist/plugins/EsbuildMinifyFix.js +136 -0
- package/dist/plugins/ProgressPlugin.js +68 -43
- package/dist/plugins/RuntimePublicPathPlugin.d.ts +4 -0
- package/dist/plugins/RuntimePublicPathPlugin.js +45 -0
- package/dist/plugins/_SamplePlugin.d.ts +1 -1
- package/dist/plugins/_SamplePlugin.js +37 -14
- package/dist/requireHook.js +44 -27
- package/dist/schema.d.ts +4 -3
- package/dist/schema.js +175 -69
- package/dist/server/server.d.ts +4 -3
- package/dist/server/server.js +219 -154
- package/dist/server/ws.d.ts +8 -3
- package/dist/server/ws.js +72 -38
- package/dist/swcPlugins/autoCSSModules.d.ts +11 -2
- package/dist/swcPlugins/autoCSSModules.js +60 -32
- package/dist/swcPlugins/changeImportFromString.d.ts +2 -0
- package/dist/swcPlugins/changeImportFromString.js +32 -0
- package/dist/swcPlugins/lockCoreJS.d.ts +6 -0
- package/dist/swcPlugins/lockCoreJS.js +56 -0
- package/dist/types.d.ts +53 -9
- package/dist/types.js +61 -29
- package/dist/utils/browsersList.js +31 -8
- package/dist/utils/depMatch.js +65 -39
- package/dist/utils/formatWebpackMessages.js +119 -91
- package/dist/utils/getEsBuildTarget.d.ts +7 -0
- package/dist/utils/getEsBuildTarget.js +46 -0
- package/dist/utils/pkgUpContainsName.d.ts +1 -0
- package/dist/utils/pkgUpContainsName.js +50 -0
- package/package.json +89 -81
- package/compiled/@svgr/webpack/.svgo.yml +0 -75
- package/compiled/@svgr/webpack/LICENSE +0 -7
- package/compiled/@svgr/webpack/index.js +0 -343
- package/compiled/@svgr/webpack/package.json +0 -1
- package/compiled/css-loader/api.js +0 -102
- package/compiled/css-loader/getUrl.js +0 -29
- package/compiled/css-loader/index.js +0 -2
- package/compiled/css-loader/noSourceMaps.js +0 -5
- package/compiled/css-loader/package.json +0 -1
- package/compiled/css-loader/sourceMaps.js +0 -22
- package/compiled/express/body-parser/index.d.ts +0 -104
- package/compiled/express/connect/index.d.ts +0 -93
- package/compiled/express/express-serve-static-core/index.d.ts +0 -1252
- package/compiled/express/index.d.ts +0 -133
- package/compiled/express/index.js +0 -338
- package/compiled/express/mime/index.d.ts +0 -35
- package/compiled/express/package.json +0 -1
- package/compiled/express/qs/index.d.ts +0 -62
- package/compiled/express/range-parser/index.d.ts +0 -35
- package/compiled/express/serve-static/index.d.ts +0 -108
- package/compiled/http-proxy-middleware/LICENSE +0 -22
- package/compiled/http-proxy-middleware/dist/index.d.ts +0 -4
- package/compiled/http-proxy-middleware/dist/types.d.ts +0 -54
- package/compiled/http-proxy-middleware/http-proxy/index.d.ts +0 -226
- package/compiled/http-proxy-middleware/index.js +0 -66
- package/compiled/http-proxy-middleware/package.json +0 -1
- package/compiled/less/index.js +0 -31
- package/compiled/less/package.json +0 -1
- package/compiled/react-refresh/index.js +0 -19
- package/compiled/swc-loader/LICENSE +0 -25
- package/compiled/swc-loader/index.js +0 -1
- package/compiled/swc-loader/package.json +0 -1
- package/compiled/tapable/index.js +0 -1
- package/compiled/tapable/package.json +0 -1
- package/compiled/tapable/tapable.d.ts +0 -116
- package/dist/build.d.ts.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/client/client.d.ts.map +0 -1
- package/dist/client/client.js +0 -239
- package/dist/config/_sampleFeature.d.ts.map +0 -1
- package/dist/config/assetRules.d.ts.map +0 -1
- package/dist/config/bundleAnalyzerPlugin.d.ts.map +0 -1
- package/dist/config/compressPlugin.d.ts.map +0 -1
- package/dist/config/config.d.ts.map +0 -1
- package/dist/config/copyPlugin.d.ts.map +0 -1
- package/dist/config/cssRules.d.ts.map +0 -1
- package/dist/config/definePlugin.d.ts.map +0 -1
- package/dist/config/fastRefreshPlugin.d.ts.map +0 -1
- package/dist/config/ignorePlugin.d.ts.map +0 -1
- package/dist/config/javaScriptRules.d.ts.map +0 -1
- package/dist/config/miniCSSExtractPlugin.d.ts.map +0 -1
- package/dist/config/nodePolyfill.d.ts.map +0 -1
- package/dist/config/progressPlugin.d.ts.map +0 -1
- package/dist/config/purgecssWebpackPlugin.d.ts.map +0 -1
- package/dist/config/speedMeasureWebpackPlugin.d.ts.map +0 -1
- package/dist/config/svgRules.d.ts.map +0 -1
- package/dist/constants.d.ts.map +0 -1
- package/dist/dev.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/plugins/ESBuildCSSMinifyPlugin.d.ts +0 -11
- package/dist/plugins/ESBuildCSSMinifyPlugin.d.ts.map +0 -1
- package/dist/plugins/ESBuildCSSMinifyPlugin.js +0 -65
- package/dist/plugins/ProgressPlugin.d.ts.map +0 -1
- package/dist/plugins/_SamplePlugin.d.ts.map +0 -1
- package/dist/requireHook.d.ts.map +0 -1
- package/dist/schema.d.ts.map +0 -1
- package/dist/server/server.d.ts.map +0 -1
- package/dist/server/ws.d.ts.map +0 -1
- package/dist/swcPlugins/autoCSSModules.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/utils/browsersList.d.ts.map +0 -1
- package/dist/utils/depMatch.d.ts.map +0 -1
- package/dist/utils/formatWebpackMessages.d.ts.map +0 -1
- /package/{dist → client}/client/client.d.ts +0 -0
- /package/compiled/{css-loader → file-loader}/LICENSE +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/swcPlugins/changeImportFromString.ts
|
|
20
|
+
var changeImportFromString_exports = {};
|
|
21
|
+
__export(changeImportFromString_exports, {
|
|
22
|
+
changeImportFromString: () => changeImportFromString
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(changeImportFromString_exports);
|
|
25
|
+
var changeImportFromString = (e, v) => {
|
|
26
|
+
e.source.value = v;
|
|
27
|
+
e.source.raw = `'${v}'`;
|
|
28
|
+
};
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
changeImportFromString
|
|
32
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/swcPlugins/lockCoreJS.ts
|
|
30
|
+
var lockCoreJS_exports = {};
|
|
31
|
+
__export(lockCoreJS_exports, {
|
|
32
|
+
default: () => lockCoreJS_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(lockCoreJS_exports);
|
|
35
|
+
var import_Visitor = __toESM(require("@swc/core/Visitor"));
|
|
36
|
+
var import_utils = require("@umijs/utils");
|
|
37
|
+
var import_path = require("path");
|
|
38
|
+
var import_changeImportFromString = require("./changeImportFromString");
|
|
39
|
+
function addLastSlash(path) {
|
|
40
|
+
return path.endsWith("/") ? path : `${path}/`;
|
|
41
|
+
}
|
|
42
|
+
var LockCoreJS = class extends import_Visitor.default {
|
|
43
|
+
visitImportDeclaration(expression) {
|
|
44
|
+
const { source } = expression;
|
|
45
|
+
let { value, type } = source;
|
|
46
|
+
if (type === "StringLiteral" && value.startsWith("core-js/")) {
|
|
47
|
+
const newValue = value.replace(
|
|
48
|
+
/^core-js\//,
|
|
49
|
+
addLastSlash((0, import_utils.winPath)((0, import_path.dirname)(require.resolve("core-js/package.json"))))
|
|
50
|
+
);
|
|
51
|
+
(0, import_changeImportFromString.changeImportFromString)(expression, newValue);
|
|
52
|
+
}
|
|
53
|
+
return expression;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
var lockCoreJS_default = LockCoreJS;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import type { Options as
|
|
2
|
-
import {
|
|
1
|
+
import type { Options as SwcConfig } from '@swc/core';
|
|
2
|
+
import type { HttpsServerOptions, ProxyOptions } from '@umijs/bundler-utils';
|
|
3
|
+
import type { TransformOptions as EsbuildOptions } from '@umijs/bundler-utils/compiled/esbuild';
|
|
4
|
+
import type { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
|
|
5
|
+
import webpack, { Configuration } from '../compiled/webpack';
|
|
3
6
|
import Config from '../compiled/webpack-5-chain';
|
|
4
7
|
export declare enum Env {
|
|
5
8
|
development = "development",
|
|
@@ -21,6 +24,7 @@ export declare enum JSMinifier {
|
|
|
21
24
|
export declare enum CSSMinifier {
|
|
22
25
|
esbuild = "esbuild",
|
|
23
26
|
cssnano = "cssnano",
|
|
27
|
+
parcelCSS = "parcelCSS",
|
|
24
28
|
none = "none"
|
|
25
29
|
}
|
|
26
30
|
export interface ICopy {
|
|
@@ -30,11 +34,27 @@ export interface ICopy {
|
|
|
30
34
|
declare type WebpackConfig = Required<Configuration>;
|
|
31
35
|
declare type IBabelPlugin = Function | string | [string, {
|
|
32
36
|
[key: string]: any;
|
|
33
|
-
}]
|
|
37
|
+
}] | [string, {
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
}, string];
|
|
40
|
+
export interface DeadCodeParams {
|
|
41
|
+
patterns?: string[];
|
|
42
|
+
exclude?: string[];
|
|
43
|
+
failOnHint?: boolean;
|
|
44
|
+
detectUnusedFiles?: boolean;
|
|
45
|
+
detectUnusedExport?: boolean;
|
|
46
|
+
context?: string;
|
|
47
|
+
}
|
|
34
48
|
export interface IConfig {
|
|
35
49
|
alias?: Record<string, string>;
|
|
36
50
|
autoCSSModules?: boolean;
|
|
37
|
-
|
|
51
|
+
base?: string;
|
|
52
|
+
chainWebpack?: {
|
|
53
|
+
(memo: Config, args: {
|
|
54
|
+
env: keyof typeof Env;
|
|
55
|
+
webpack: typeof webpack;
|
|
56
|
+
}): void;
|
|
57
|
+
};
|
|
38
58
|
copy?: ICopy[] | string[];
|
|
39
59
|
cssLoader?: {
|
|
40
60
|
[key: string]: any;
|
|
@@ -42,38 +62,44 @@ export interface IConfig {
|
|
|
42
62
|
cssLoaderModules?: {
|
|
43
63
|
[key: string]: any;
|
|
44
64
|
};
|
|
45
|
-
cssMinifier?: CSSMinifier
|
|
65
|
+
cssMinifier?: `${CSSMinifier}`;
|
|
46
66
|
cssMinifierOptions?: {
|
|
47
67
|
[key: string]: any;
|
|
48
68
|
};
|
|
49
69
|
define?: {
|
|
50
70
|
[key: string]: any;
|
|
51
71
|
};
|
|
52
|
-
depTranspiler?: Transpiler
|
|
72
|
+
depTranspiler?: `${Transpiler}`;
|
|
53
73
|
devtool?: Config.DevTool;
|
|
74
|
+
deadCode?: DeadCodeParams;
|
|
75
|
+
https?: HttpsServerOptions;
|
|
54
76
|
externals?: WebpackConfig['externals'];
|
|
55
77
|
esm?: {
|
|
56
78
|
[key: string]: any;
|
|
57
79
|
};
|
|
58
80
|
extraBabelPlugins?: IBabelPlugin[];
|
|
59
81
|
extraBabelPresets?: IBabelPlugin[];
|
|
82
|
+
extraBabelIncludes?: Array<string | RegExp>;
|
|
60
83
|
extraPostCSSPlugins?: any[];
|
|
61
84
|
hash?: boolean;
|
|
62
85
|
ignoreMomentLocale?: boolean;
|
|
63
|
-
jsMinifier?: JSMinifier
|
|
86
|
+
jsMinifier?: `${JSMinifier}`;
|
|
64
87
|
jsMinifierOptions?: {
|
|
65
88
|
[key: string]: any;
|
|
66
89
|
};
|
|
67
90
|
lessLoader?: {
|
|
68
91
|
[key: string]: any;
|
|
69
92
|
};
|
|
93
|
+
normalCSSLoaderModules?: {
|
|
94
|
+
[key: string]: any;
|
|
95
|
+
};
|
|
70
96
|
outputPath?: string;
|
|
71
97
|
postcssLoader?: {
|
|
72
98
|
[key: string]: any;
|
|
73
99
|
};
|
|
74
100
|
proxy?: {
|
|
75
101
|
[key: string]: ProxyOptions;
|
|
76
|
-
};
|
|
102
|
+
} | ProxyOptions[];
|
|
77
103
|
publicPath?: string;
|
|
78
104
|
purgeCSS?: {
|
|
79
105
|
[key: string]: any;
|
|
@@ -81,7 +107,8 @@ export interface IConfig {
|
|
|
81
107
|
sassLoader?: {
|
|
82
108
|
[key: string]: any;
|
|
83
109
|
};
|
|
84
|
-
srcTranspiler?: Transpiler
|
|
110
|
+
srcTranspiler?: `${Transpiler}`;
|
|
111
|
+
srcTranspilerOptions?: ISrcTranspilerOpts;
|
|
85
112
|
styleLoader?: {
|
|
86
113
|
[key: string]: any;
|
|
87
114
|
};
|
|
@@ -95,6 +122,23 @@ export interface IConfig {
|
|
|
95
122
|
[key: string]: any;
|
|
96
123
|
};
|
|
97
124
|
writeToDisk?: boolean;
|
|
125
|
+
babelLoaderCustomize?: string;
|
|
126
|
+
analyze?: BundleAnalyzerPlugin.Options;
|
|
127
|
+
esbuildMinifyIIFE?: boolean;
|
|
128
|
+
checkDepCssModules?: boolean;
|
|
98
129
|
[key: string]: any;
|
|
99
130
|
}
|
|
131
|
+
export interface ISrcTranspilerOpts {
|
|
132
|
+
swc?: Partial<SwcConfig>;
|
|
133
|
+
esbuild?: Partial<EsbuildOptions>;
|
|
134
|
+
}
|
|
135
|
+
export interface ISwcPluginOpts {
|
|
136
|
+
enableAutoCssModulesPlugin?: boolean;
|
|
137
|
+
}
|
|
138
|
+
export interface SwcOptions extends SwcConfig, ISwcPluginOpts {
|
|
139
|
+
sync?: boolean;
|
|
140
|
+
parseMap?: boolean;
|
|
141
|
+
excludeFiles?: Array<string | RegExp>;
|
|
142
|
+
mergeConfigs?: Partial<SwcConfig>;
|
|
143
|
+
}
|
|
100
144
|
export {};
|
package/dist/types.js
CHANGED
|
@@ -1,29 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
var
|
|
10
|
-
(function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/types.ts
|
|
20
|
+
var types_exports = {};
|
|
21
|
+
__export(types_exports, {
|
|
22
|
+
CSSMinifier: () => CSSMinifier,
|
|
23
|
+
Env: () => Env,
|
|
24
|
+
JSMinifier: () => JSMinifier,
|
|
25
|
+
Transpiler: () => Transpiler
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(types_exports);
|
|
28
|
+
var Env = /* @__PURE__ */ ((Env2) => {
|
|
29
|
+
Env2["development"] = "development";
|
|
30
|
+
Env2["production"] = "production";
|
|
31
|
+
return Env2;
|
|
32
|
+
})(Env || {});
|
|
33
|
+
var Transpiler = /* @__PURE__ */ ((Transpiler2) => {
|
|
34
|
+
Transpiler2["babel"] = "babel";
|
|
35
|
+
Transpiler2["swc"] = "swc";
|
|
36
|
+
Transpiler2["esbuild"] = "esbuild";
|
|
37
|
+
Transpiler2["none"] = "none";
|
|
38
|
+
return Transpiler2;
|
|
39
|
+
})(Transpiler || {});
|
|
40
|
+
var JSMinifier = /* @__PURE__ */ ((JSMinifier2) => {
|
|
41
|
+
JSMinifier2["terser"] = "terser";
|
|
42
|
+
JSMinifier2["swc"] = "swc";
|
|
43
|
+
JSMinifier2["esbuild"] = "esbuild";
|
|
44
|
+
JSMinifier2["uglifyJs"] = "uglifyJs";
|
|
45
|
+
JSMinifier2["none"] = "none";
|
|
46
|
+
return JSMinifier2;
|
|
47
|
+
})(JSMinifier || {});
|
|
48
|
+
var CSSMinifier = /* @__PURE__ */ ((CSSMinifier2) => {
|
|
49
|
+
CSSMinifier2["esbuild"] = "esbuild";
|
|
50
|
+
CSSMinifier2["cssnano"] = "cssnano";
|
|
51
|
+
CSSMinifier2["parcelCSS"] = "parcelCSS";
|
|
52
|
+
CSSMinifier2["none"] = "none";
|
|
53
|
+
return CSSMinifier2;
|
|
54
|
+
})(CSSMinifier || {});
|
|
55
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
+
0 && (module.exports = {
|
|
57
|
+
CSSMinifier,
|
|
58
|
+
Env,
|
|
59
|
+
JSMinifier,
|
|
60
|
+
Transpiler
|
|
61
|
+
});
|
|
@@ -1,10 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/utils/browsersList.ts
|
|
20
|
+
var browsersList_exports = {};
|
|
21
|
+
__export(browsersList_exports, {
|
|
22
|
+
getBrowsersList: () => getBrowsersList
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(browsersList_exports);
|
|
4
25
|
function getBrowsersList({ targets }) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}));
|
|
26
|
+
return targets.browsers || Object.keys(targets).map((key) => {
|
|
27
|
+
return `${key} >= ${targets[key] === true ? "0" : targets[key]}`;
|
|
28
|
+
});
|
|
9
29
|
}
|
|
10
|
-
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
getBrowsersList
|
|
33
|
+
});
|
package/dist/utils/depMatch.js
CHANGED
|
@@ -1,46 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/utils/depMatch.ts
|
|
20
|
+
var depMatch_exports = {};
|
|
21
|
+
__export(depMatch_exports, {
|
|
22
|
+
cleanCache: () => cleanCache,
|
|
23
|
+
es5ImcompatibleVersionsToPkg: () => es5ImcompatibleVersionsToPkg,
|
|
24
|
+
isMatch: () => isMatch
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(depMatch_exports);
|
|
27
|
+
var import_utils = require("@umijs/utils");
|
|
28
|
+
var import_path = require("path");
|
|
29
|
+
var import_pkgUpContainsName = require("./pkgUpContainsName");
|
|
30
|
+
var cache = /* @__PURE__ */ new Map();
|
|
7
31
|
function cleanCache() {
|
|
8
|
-
|
|
32
|
+
cache.clear();
|
|
9
33
|
}
|
|
10
|
-
exports.cleanCache = cleanCache;
|
|
11
34
|
function isMatch(opts) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
ret = false;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
cache.set(dir, ret);
|
|
35
|
-
return ret;
|
|
35
|
+
const dir = (0, import_utils.winPath)((0, import_path.dirname)(opts.path));
|
|
36
|
+
if (cache.has(dir)) {
|
|
37
|
+
return !!cache.get(dir);
|
|
38
|
+
} else {
|
|
39
|
+
const pkgPath = (0, import_pkgUpContainsName.pkgUpContainsName)(opts.path);
|
|
40
|
+
let ret;
|
|
41
|
+
if (!pkgPath) {
|
|
42
|
+
ret = false;
|
|
43
|
+
} else {
|
|
44
|
+
const { name, version } = require(pkgPath);
|
|
45
|
+
if (opts.pkgs[name]) {
|
|
46
|
+
ret = opts.pkgs[name].some((v) => {
|
|
47
|
+
return import_utils.semver.satisfies(version, v);
|
|
48
|
+
});
|
|
49
|
+
} else {
|
|
50
|
+
ret = false;
|
|
51
|
+
}
|
|
36
52
|
}
|
|
53
|
+
cache.set(dir, ret);
|
|
54
|
+
return ret;
|
|
55
|
+
}
|
|
37
56
|
}
|
|
38
|
-
exports.isMatch = isMatch;
|
|
39
57
|
function es5ImcompatibleVersionsToPkg() {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
58
|
+
const {
|
|
59
|
+
config: { "es5-imcompatible-versions": config }
|
|
60
|
+
} = require("es5-imcompatible-versions/package.json");
|
|
61
|
+
return Object.keys(config).reduce((memo, key) => {
|
|
62
|
+
memo[key] = /* versions */
|
|
63
|
+
Object.keys(config[key]);
|
|
64
|
+
return memo;
|
|
65
|
+
}, {});
|
|
45
66
|
}
|
|
46
|
-
|
|
67
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
68
|
+
0 && (module.exports = {
|
|
69
|
+
cleanCache,
|
|
70
|
+
es5ImcompatibleVersionsToPkg,
|
|
71
|
+
isMatch
|
|
72
|
+
});
|