@umijs/bundler-webpack 4.0.7 → 4.0.10
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 +295 -194
- 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 -68
- 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 +114 -95
- package/dist/config/config.d.ts +1 -0
- package/dist/config/config.js +204 -215
- package/dist/config/copyPlugin.js +59 -40
- package/dist/config/cssRules.js +136 -131
- package/dist/config/definePlugin.js +71 -35
- 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 +147 -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 +174 -134
- package/dist/index.js +22 -20
- package/dist/loader/svgr.js +73 -54
- package/dist/loader/swc.js +110 -69
- package/dist/parcelCSS.js +31 -27
- 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 +123 -96
- 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.d.ts +2 -1
- 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.d.ts +3 -1
- package/dist/utils/getEsBuildTarget.js +39 -11
- package/package.json +12 -16
- 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/compiled/react-refresh/LICENSE +0 -21
- package/compiled/react-refresh/index.js +0 -21
- package/compiled/react-refresh/package.json +0 -1
- package/dist/client/client.js +0 -245
package/dist/server/ws.d.ts
CHANGED
package/dist/server/ws.js
CHANGED
|
@@ -1,42 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
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 });
|
|
4
10
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
+
// src/server/ws.ts
|
|
23
|
+
var ws_exports = {};
|
|
24
|
+
__export(ws_exports, {
|
|
25
|
+
createWebSocketServer: () => createWebSocketServer
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(ws_exports);
|
|
28
|
+
var import_utils = require("@umijs/utils");
|
|
29
|
+
var import_ws = __toESM(require("../../compiled/ws"));
|
|
9
30
|
function createWebSocketServer(server) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
const wss = new import_ws.default.Server({
|
|
32
|
+
noServer: true
|
|
33
|
+
});
|
|
34
|
+
server.on("upgrade", (req, socket, head) => {
|
|
35
|
+
if (req.headers["sec-websocket-protocol"] === "webpack-hmr") {
|
|
36
|
+
wss.handleUpgrade(req, socket, head, (ws) => {
|
|
37
|
+
wss.emit("connection", ws, req);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
wss.on("connection", (socket) => {
|
|
42
|
+
socket.send(JSON.stringify({ type: "connected" }));
|
|
43
|
+
});
|
|
44
|
+
wss.on("error", (e) => {
|
|
45
|
+
if (e.code !== "EADDRINUSE") {
|
|
46
|
+
console.error(import_utils.chalk.red(`WebSocket server error:
|
|
47
|
+
${e.stack || e.message}`));
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return {
|
|
51
|
+
send(message) {
|
|
52
|
+
wss.clients.forEach((client) => {
|
|
53
|
+
if (client.readyState === import_ws.default.OPEN) {
|
|
54
|
+
client.send(message);
|
|
26
55
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
});
|
|
35
|
-
},
|
|
36
|
-
wss,
|
|
37
|
-
close() {
|
|
38
|
-
wss.close();
|
|
39
|
-
},
|
|
40
|
-
};
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
wss,
|
|
59
|
+
close() {
|
|
60
|
+
wss.close();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
41
63
|
}
|
|
42
|
-
|
|
64
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
65
|
+
0 && (module.exports = {
|
|
66
|
+
createWebSocketServer
|
|
67
|
+
});
|
|
@@ -1,34 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
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 });
|
|
4
10
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
+
// src/swcPlugins/autoCSSModules.ts
|
|
23
|
+
var autoCSSModules_exports = {};
|
|
24
|
+
__export(autoCSSModules_exports, {
|
|
25
|
+
default: () => autoCSSModules_default
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(autoCSSModules_exports);
|
|
28
|
+
var import_Visitor = __toESM(require("@swc/core/Visitor"));
|
|
29
|
+
var import_utils = require("@umijs/utils");
|
|
30
|
+
var import_changeImportFromString = require("./changeImportFromString");
|
|
31
|
+
var AutoCSSModule = class extends import_Visitor.default {
|
|
32
|
+
visitTsType(expression) {
|
|
33
|
+
return expression;
|
|
34
|
+
}
|
|
35
|
+
visitModuleItem(n) {
|
|
36
|
+
if (n.type === "ImportDeclaration") {
|
|
37
|
+
return this.visitImportDeclaration(n);
|
|
23
38
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
return n;
|
|
40
|
+
}
|
|
41
|
+
visitImportDeclaration(expression) {
|
|
42
|
+
const { specifiers, source } = expression;
|
|
43
|
+
const { value } = source;
|
|
44
|
+
if (specifiers.length && (0, import_utils.isStyleFile)({ filename: value })) {
|
|
45
|
+
const newImportFrom = `${value}?modules`;
|
|
46
|
+
(0, import_changeImportFromString.changeImportFromString)(expression, newImportFrom);
|
|
32
47
|
}
|
|
33
|
-
|
|
34
|
-
|
|
48
|
+
return expression;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
var autoCSSModules_default = AutoCSSModule;
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {});
|
|
@@ -1,10 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
e.source.raw = `'${v}'`;
|
|
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 });
|
|
9
8
|
};
|
|
10
|
-
|
|
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
|
+
});
|
|
@@ -1,24 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
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 });
|
|
4
10
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
+
// src/swcPlugins/lockCoreJS.ts
|
|
23
|
+
var lockCoreJS_exports = {};
|
|
24
|
+
__export(lockCoreJS_exports, {
|
|
25
|
+
default: () => lockCoreJS_default
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(lockCoreJS_exports);
|
|
28
|
+
var import_Visitor = __toESM(require("@swc/core/Visitor"));
|
|
29
|
+
var import_utils = require("@umijs/utils");
|
|
30
|
+
var import_path = require("path");
|
|
31
|
+
var import_changeImportFromString = require("./changeImportFromString");
|
|
10
32
|
function addLastSlash(path) {
|
|
11
|
-
|
|
33
|
+
return path.endsWith("/") ? path : `${path}/`;
|
|
12
34
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
return expression;
|
|
35
|
+
var LockCoreJS = class extends import_Visitor.default {
|
|
36
|
+
visitImportDeclaration(expression) {
|
|
37
|
+
const { source } = expression;
|
|
38
|
+
let { value, type } = source;
|
|
39
|
+
if (type === "StringLiteral" && value.startsWith("core-js/")) {
|
|
40
|
+
const newValue = value.replace(/^core-js\//, addLastSlash((0, import_utils.winPath)((0, import_path.dirname)(require.resolve("core-js/package.json")))));
|
|
41
|
+
(0, import_changeImportFromString.changeImportFromString)(expression, newValue);
|
|
22
42
|
}
|
|
23
|
-
|
|
24
|
-
|
|
43
|
+
return expression;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
var lockCoreJS_default = LockCoreJS;
|
|
47
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
+
0 && (module.exports = {});
|
package/dist/types.d.ts
CHANGED
|
@@ -75,7 +75,7 @@ export interface IConfig {
|
|
|
75
75
|
extraPostCSSPlugins?: any[];
|
|
76
76
|
hash?: boolean;
|
|
77
77
|
ignoreMomentLocale?: boolean;
|
|
78
|
-
jsMinifier?: JSMinifier
|
|
78
|
+
jsMinifier?: `${JSMinifier}`;
|
|
79
79
|
jsMinifierOptions?: {
|
|
80
80
|
[key: string]: any;
|
|
81
81
|
};
|
|
@@ -110,6 +110,7 @@ export interface IConfig {
|
|
|
110
110
|
[key: string]: any;
|
|
111
111
|
};
|
|
112
112
|
writeToDisk?: boolean;
|
|
113
|
+
babelLoaderCustomize?: string;
|
|
113
114
|
[key: string]: any;
|
|
114
115
|
}
|
|
115
116
|
export interface SwcOptions extends SwcConfig {
|
package/dist/types.js
CHANGED
|
@@ -1,30 +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
|
-
|
|
30
|
-
|
|
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,70 @@
|
|
|
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 cache = /* @__PURE__ */ new Map();
|
|
7
30
|
function cleanCache() {
|
|
8
|
-
|
|
31
|
+
cache.clear();
|
|
9
32
|
}
|
|
10
|
-
exports.cleanCache = cleanCache;
|
|
11
33
|
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;
|
|
34
|
+
const dir = (0, import_utils.winPath)((0, import_path.dirname)(opts.path));
|
|
35
|
+
if (cache.has(dir)) {
|
|
36
|
+
return !!cache.get(dir);
|
|
37
|
+
} else {
|
|
38
|
+
const pkgPath = import_utils.pkgUp.pkgUpSync({ cwd: opts.path });
|
|
39
|
+
let ret;
|
|
40
|
+
if (!pkgPath) {
|
|
41
|
+
ret = false;
|
|
42
|
+
} else {
|
|
43
|
+
const { name, version } = require(pkgPath);
|
|
44
|
+
if (opts.pkgs[name]) {
|
|
45
|
+
ret = opts.pkgs[name].some((v) => {
|
|
46
|
+
return import_utils.semver.satisfies(version, v);
|
|
47
|
+
});
|
|
48
|
+
} else {
|
|
49
|
+
ret = false;
|
|
50
|
+
}
|
|
36
51
|
}
|
|
52
|
+
cache.set(dir, ret);
|
|
53
|
+
return ret;
|
|
54
|
+
}
|
|
37
55
|
}
|
|
38
|
-
exports.isMatch = isMatch;
|
|
39
56
|
function es5ImcompatibleVersionsToPkg() {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
57
|
+
const {
|
|
58
|
+
config: { "es5-imcompatible-versions": config }
|
|
59
|
+
} = require("es5-imcompatible-versions/package.json");
|
|
60
|
+
return Object.keys(config).reduce((memo, key) => {
|
|
61
|
+
memo[key] = Object.keys(config[key]);
|
|
62
|
+
return memo;
|
|
63
|
+
}, {});
|
|
45
64
|
}
|
|
46
|
-
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
cleanCache,
|
|
68
|
+
es5ImcompatibleVersionsToPkg,
|
|
69
|
+
isMatch
|
|
70
|
+
});
|