@umijs/bundler-webpack 4.0.5 → 4.0.8
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/{dist → client}/client/client.d.ts +0 -0
- package/client/client/client.js +172 -192
- package/client/constants.d.ts +15 -0
- package/client/constants.js +28 -19
- package/client/utils/formatWebpackMessages.d.ts +12 -0
- package/client/utils/formatWebpackMessages.js +68 -86
- package/dist/build.d.ts +1 -1
- package/dist/build.js +105 -61
- package/dist/cli.js +77 -69
- package/dist/config/_sampleFeature.js +33 -9
- package/dist/config/assetRules.js +45 -36
- package/dist/config/bundleAnalyzerPlugin.js +39 -17
- package/dist/config/compressPlugin.js +113 -95
- package/dist/config/config.d.ts +1 -0
- package/dist/config/config.js +204 -215
- package/dist/config/copyPlugin.js +58 -33
- package/dist/config/cssRules.js +136 -131
- package/dist/config/definePlugin.d.ts +1 -0
- package/dist/config/definePlugin.js +71 -31
- package/dist/config/detectDeadCode.js +120 -108
- package/dist/config/detectDeadCodePlugin.js +78 -63
- package/dist/config/fastRefreshPlugin.js +39 -20
- package/dist/config/forkTSCheckerPlugin.js +38 -19
- package/dist/config/harmonyLinkingErrorPlugin.js +48 -29
- package/dist/config/ignorePlugin.js +38 -14
- package/dist/config/javaScriptRules.js +146 -173
- package/dist/config/manifestPlugin.js +51 -15
- package/dist/config/miniCSSExtractPlugin.js +42 -22
- package/dist/config/nodePolyfill.js +65 -26
- package/dist/config/nodePrefixPlugin.js +36 -12
- package/dist/config/progressPlugin.js +37 -13
- package/dist/config/purgecssWebpackPlugin.js +41 -19
- package/dist/config/speedMeasureWebpackPlugin.js +41 -20
- package/dist/config/ssrPlugin.js +83 -63
- package/dist/config/svgRules.js +74 -46
- package/dist/constants.js +57 -22
- package/dist/dev.d.ts +1 -1
- package/dist/dev.js +170 -129
- package/dist/index.d.ts +0 -2
- package/dist/index.js +22 -35
- package/dist/loader/svgr.js +73 -54
- package/dist/loader/swc.js +110 -69
- package/dist/parcelCSS.d.ts +2 -0
- package/dist/parcelCSS.js +32 -0
- package/dist/plugins/ProgressPlugin.js +66 -43
- package/dist/plugins/RuntimePublicPathPlugin.js +42 -23
- package/dist/plugins/_SamplePlugin.js +39 -14
- package/dist/requireHook.js +37 -27
- package/dist/schema.js +119 -95
- package/dist/server/server.d.ts +0 -1
- package/dist/server/server.js +214 -184
- package/dist/server/ws.d.ts +0 -2
- package/dist/server/ws.js +63 -38
- package/dist/swcPlugins/autoCSSModules.js +50 -31
- package/dist/swcPlugins/changeImportFromString.js +31 -9
- package/dist/swcPlugins/lockCoreJS.js +44 -20
- package/dist/types.js +61 -30
- package/dist/utils/browsersList.js +31 -8
- package/dist/utils/depMatch.js +63 -39
- package/dist/utils/formatWebpackMessages.js +93 -91
- package/dist/utils/getEsBuildTarget.js +32 -10
- package/package.json +9 -11
- package/compiled/fork-ts-checker-webpack-plugin/LICENSE +0 -21
- package/compiled/fork-ts-checker-webpack-plugin/fsevents.node +0 -0
- package/compiled/fork-ts-checker-webpack-plugin/index.js +0 -42
- package/compiled/fork-ts-checker-webpack-plugin/package.json +0 -1
- package/dist/client/client.js +0 -245
package/dist/loader/swc.js
CHANGED
|
@@ -1,74 +1,115 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
21
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
|
+
var __objRest = (source, exclude) => {
|
|
23
|
+
var target = {};
|
|
24
|
+
for (var prop in source)
|
|
25
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
26
|
+
target[prop] = source[prop];
|
|
27
|
+
if (source != null && __getOwnPropSymbols)
|
|
28
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
29
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
30
|
+
target[prop] = source[prop];
|
|
31
|
+
}
|
|
32
|
+
return target;
|
|
33
|
+
};
|
|
34
|
+
var __export = (target, all) => {
|
|
35
|
+
for (var name in all)
|
|
36
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
37
|
+
};
|
|
38
|
+
var __copyProps = (to, from, except, desc) => {
|
|
39
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
40
|
+
for (let key of __getOwnPropNames(from))
|
|
41
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
42
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
43
|
+
}
|
|
44
|
+
return to;
|
|
45
|
+
};
|
|
46
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
47
|
+
|
|
48
|
+
// swc.ts
|
|
49
|
+
var swc_exports = {};
|
|
50
|
+
__export(swc_exports, {
|
|
51
|
+
default: () => swc_default
|
|
52
|
+
});
|
|
53
|
+
module.exports = __toCommonJS(swc_exports);
|
|
54
|
+
var import_core = require("@swc/core");
|
|
55
|
+
var import_types = require("../types");
|
|
5
56
|
function getBaseOpts({ filename }) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
react: {
|
|
30
|
-
runtime: 'automatic',
|
|
31
|
-
pragma: 'React.createElement',
|
|
32
|
-
pragmaFrag: 'React.Fragment',
|
|
33
|
-
throwIfNamespace: true,
|
|
34
|
-
development: isDev,
|
|
35
|
-
useBuiltins: true,
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
return swcOpts;
|
|
41
|
-
}
|
|
42
|
-
function swcLoader(contents) {
|
|
43
|
-
// 启用异步模式
|
|
44
|
-
const callback = this.async();
|
|
45
|
-
const loaderOpts = this.getOptions();
|
|
46
|
-
const { sync = false, parseMap = false, ...otherOpts } = loaderOpts;
|
|
47
|
-
const filename = this.resourcePath;
|
|
48
|
-
const swcOpts = {
|
|
49
|
-
...getBaseOpts({
|
|
50
|
-
filename,
|
|
51
|
-
}),
|
|
52
|
-
filename,
|
|
53
|
-
sourceMaps: this.sourceMap,
|
|
54
|
-
sourceFileName: filename,
|
|
55
|
-
...otherOpts,
|
|
56
|
-
};
|
|
57
|
-
try {
|
|
58
|
-
if (sync) {
|
|
59
|
-
const output = (0, core_1.transformSync)(contents, swcOpts);
|
|
60
|
-
callback(null, output.code, parseMap ? JSON.parse(output.map) : output.map);
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
(0, core_1.transform)(contents, swcOpts).then((output) => {
|
|
64
|
-
callback(null, output.code, parseMap ? JSON.parse(output.map) : output.map);
|
|
65
|
-
}, (err) => {
|
|
66
|
-
callback(err);
|
|
67
|
-
});
|
|
57
|
+
const isTSFile = filename.endsWith(".ts");
|
|
58
|
+
const isTypeScript = isTSFile || filename.endsWith(".tsx");
|
|
59
|
+
const isDev = process.env.NODE_ENV === import_types.Env.development;
|
|
60
|
+
const swcOpts = {
|
|
61
|
+
module: {
|
|
62
|
+
type: "es6",
|
|
63
|
+
ignoreDynamic: true
|
|
64
|
+
},
|
|
65
|
+
jsc: {
|
|
66
|
+
parser: {
|
|
67
|
+
syntax: isTypeScript ? "typescript" : "ecmascript",
|
|
68
|
+
[isTypeScript ? "tsx" : "jsx"]: !isTSFile,
|
|
69
|
+
dynamicImport: isTypeScript
|
|
70
|
+
},
|
|
71
|
+
target: "es2015",
|
|
72
|
+
transform: {
|
|
73
|
+
react: {
|
|
74
|
+
runtime: "automatic",
|
|
75
|
+
pragma: "React.createElement",
|
|
76
|
+
pragmaFrag: "React.Fragment",
|
|
77
|
+
throwIfNamespace: true,
|
|
78
|
+
development: isDev,
|
|
79
|
+
useBuiltins: true
|
|
68
80
|
}
|
|
81
|
+
}
|
|
69
82
|
}
|
|
70
|
-
|
|
71
|
-
|
|
83
|
+
};
|
|
84
|
+
return swcOpts;
|
|
85
|
+
}
|
|
86
|
+
function swcLoader(contents) {
|
|
87
|
+
const callback = this.async();
|
|
88
|
+
const loaderOpts = this.getOptions();
|
|
89
|
+
const _a = loaderOpts, { sync = false, parseMap = false } = _a, otherOpts = __objRest(_a, ["sync", "parseMap"]);
|
|
90
|
+
const filename = this.resourcePath;
|
|
91
|
+
const swcOpts = __spreadValues(__spreadProps(__spreadValues({}, getBaseOpts({
|
|
92
|
+
filename
|
|
93
|
+
})), {
|
|
94
|
+
filename,
|
|
95
|
+
sourceMaps: this.sourceMap,
|
|
96
|
+
sourceFileName: filename
|
|
97
|
+
}), otherOpts);
|
|
98
|
+
try {
|
|
99
|
+
if (sync) {
|
|
100
|
+
const output = (0, import_core.transformSync)(contents, swcOpts);
|
|
101
|
+
callback(null, output.code, parseMap ? JSON.parse(output.map) : output.map);
|
|
102
|
+
} else {
|
|
103
|
+
(0, import_core.transform)(contents, swcOpts).then((output) => {
|
|
104
|
+
callback(null, output.code, parseMap ? JSON.parse(output.map) : output.map);
|
|
105
|
+
}, (err) => {
|
|
106
|
+
callback(err);
|
|
107
|
+
});
|
|
72
108
|
}
|
|
109
|
+
} catch (e) {
|
|
110
|
+
callback(e);
|
|
111
|
+
}
|
|
73
112
|
}
|
|
74
|
-
|
|
113
|
+
var swc_default = swcLoader;
|
|
114
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
115
|
+
0 && (module.exports = {});
|
|
@@ -0,0 +1,32 @@
|
|
|
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(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
|
|
22
|
+
// parcelCSS.ts
|
|
23
|
+
var parcelCSS_exports = {};
|
|
24
|
+
__export(parcelCSS_exports, {
|
|
25
|
+
parcelCSS: () => parcelCSS
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(parcelCSS_exports);
|
|
28
|
+
var parcelCSS = __toESM(require("@parcel/css"));
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
parcelCSS
|
|
32
|
+
});
|
|
@@ -1,44 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
+
// ProgressPlugin.ts
|
|
20
|
+
var ProgressPlugin_exports = {};
|
|
21
|
+
__export(ProgressPlugin_exports, {
|
|
22
|
+
default: () => ProgressPlugin_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(ProgressPlugin_exports);
|
|
25
|
+
var import_webpack = require("@umijs/bundler-webpack/compiled/webpack");
|
|
26
|
+
var import_utils = require("@umijs/utils");
|
|
27
|
+
var PLUGIN_NAME = "ProgressPlugin";
|
|
28
|
+
var UmiProgressPlugin = class extends import_webpack.ProgressPlugin {
|
|
29
|
+
constructor(options = {}) {
|
|
30
|
+
super({ activeModules: true });
|
|
31
|
+
this.options = options;
|
|
32
|
+
this.handler = (percent, message, ...details) => {
|
|
33
|
+
this.updateProgress({ percent, message, details });
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
apply(compiler) {
|
|
37
|
+
const prefix = this.options.name ? `[${this.options.name}]` : "[Webpack]";
|
|
38
|
+
compiler.hooks.invalid.tap(PLUGIN_NAME, () => {
|
|
39
|
+
import_utils.logger.wait(`${prefix} Compiling...`);
|
|
40
|
+
});
|
|
41
|
+
compiler.hooks.done.tap(PLUGIN_NAME, (stats) => {
|
|
42
|
+
const { errors, warnings } = stats.toJson({
|
|
43
|
+
all: false,
|
|
44
|
+
warnings: true,
|
|
45
|
+
errors: true,
|
|
46
|
+
colors: true
|
|
47
|
+
});
|
|
48
|
+
const hasErrors = !!(errors == null ? void 0 : errors.length);
|
|
49
|
+
const hasWarnings = !!(warnings == null ? void 0 : warnings.length);
|
|
50
|
+
hasWarnings;
|
|
51
|
+
if (hasErrors) {
|
|
52
|
+
errors.forEach((error) => {
|
|
53
|
+
import_utils.logger.error(`${error.moduleName}${error.loc ? `:${error.loc}` : ""}`);
|
|
54
|
+
console.log(error.message);
|
|
18
55
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
utils_1.logger.error(`${error.moduleName}${error.loc ? `:${error.loc}` : ''}`);
|
|
32
|
-
console.log(error.message);
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
utils_1.logger.event(`${prefix} Compiled in ${stats.endTime - stats.startTime} ms (${stats.compilation.modules.size} modules)`);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
updateProgress(opts) {
|
|
41
|
-
opts;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.default = UmiProgressPlugin;
|
|
56
|
+
} else {
|
|
57
|
+
import_utils.logger.event(`${prefix} Compiled in ${stats.endTime - stats.startTime} ms (${stats.compilation.modules.size} modules)`);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
updateProgress(opts) {
|
|
62
|
+
opts;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
var ProgressPlugin_default = UmiProgressPlugin;
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {});
|
|
@@ -1,23 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
+
// RuntimePublicPathPlugin.ts
|
|
20
|
+
var RuntimePublicPathPlugin_exports = {};
|
|
21
|
+
__export(RuntimePublicPathPlugin_exports, {
|
|
22
|
+
RuntimePublicPathPlugin: () => RuntimePublicPathPlugin
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(RuntimePublicPathPlugin_exports);
|
|
25
|
+
var PLUGIN_NAME = "RuntimePublicPath";
|
|
26
|
+
var RuntimePublicPathPlugin = class {
|
|
27
|
+
apply(compiler) {
|
|
28
|
+
compiler.hooks.make.tap(PLUGIN_NAME, (compilation) => {
|
|
29
|
+
compilation.hooks.runtimeModule.tap(PLUGIN_NAME, (module2) => {
|
|
30
|
+
if (module2.constructor.name === "PublicPathRuntimeModule") {
|
|
31
|
+
if (module2.getGeneratedCode().includes("webpack:///mini-css-extract-plugin"))
|
|
32
|
+
return;
|
|
33
|
+
module2._cachedGeneratedCode = `__webpack_require__.p = (typeof globalThis !== undefined ? globalThis : window).publicPath || '/';`;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
RuntimePublicPathPlugin
|
|
42
|
+
});
|
|
@@ -1,14 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
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
|
+
// _SamplePlugin.ts
|
|
20
|
+
var SamplePlugin_exports = {};
|
|
21
|
+
__export(SamplePlugin_exports, {
|
|
22
|
+
default: () => SamplePlugin_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(SamplePlugin_exports);
|
|
25
|
+
var PLUGIN_NAME = "SamplePlugin";
|
|
26
|
+
var _SamplePlugin = class {
|
|
27
|
+
constructor(options = {}) {
|
|
28
|
+
this.options = options;
|
|
29
|
+
}
|
|
30
|
+
apply(compiler) {
|
|
31
|
+
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
|
|
32
|
+
compilation.hooks.chunkHash.tap(PLUGIN_NAME, (_) => {
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var SamplePlugin_default = _SamplePlugin;
|
|
38
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
+
0 && (module.exports = {});
|
package/dist/requireHook.js
CHANGED
|
@@ -1,31 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from))
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
}
|
|
13
|
+
return to;
|
|
8
14
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps(isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target, mod2));
|
|
16
|
+
|
|
17
|
+
// requireHook.ts
|
|
18
|
+
var import_deepImports = __toESM(require("@umijs/bundler-webpack/compiled/webpack/deepImports.json"));
|
|
19
|
+
var import_path = require("path");
|
|
20
|
+
var PKG_ROOT = (0, import_path.join)(__dirname, "../");
|
|
21
|
+
var resolve = (p) => (0, import_path.join)(PKG_ROOT, p);
|
|
22
|
+
var hookPropertyMap = /* @__PURE__ */ new Map([
|
|
23
|
+
["webpack", resolve("compiled/webpack")],
|
|
24
|
+
["webpack/package", resolve("compiled/webpack/package")],
|
|
25
|
+
["webpack/package.json", resolve("compiled/webpack/package")],
|
|
26
|
+
["webpack/lib/webpack", resolve("compiled/webpack")],
|
|
27
|
+
["webpack/lib/webpack.js", resolve("compiled/webpack")]
|
|
18
28
|
]);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
import_deepImports.default.forEach((item) => {
|
|
30
|
+
const name = item.split("/").pop();
|
|
31
|
+
hookPropertyMap.set(item, resolve(`compiled/webpack/${name}`));
|
|
32
|
+
hookPropertyMap.set(`${item}.js`, resolve(`compiled/webpack/${name}`));
|
|
23
33
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
mod._resolveFilename = function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
34
|
+
var mod = require("module");
|
|
35
|
+
var resolveFilename = mod._resolveFilename;
|
|
36
|
+
mod._resolveFilename = function(request, parent, isMain, options) {
|
|
37
|
+
const hookResolved = hookPropertyMap.get(request);
|
|
38
|
+
if (hookResolved)
|
|
39
|
+
request = hookResolved;
|
|
40
|
+
return resolveFilename.call(mod, request, parent, isMain, options);
|
|
31
41
|
};
|