@umijs/bundler-webpack 4.0.0-beta.9 → 4.0.0-rc.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/compiled/autoprefixer/browserslist/index.d.ts +11 -7
- package/compiled/autoprefixer/index.js +3 -3
- 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 +1 -1
- 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 +36 -2
- package/compiled/autoprefixer/postcss/lib/postcss.d.ts +31 -30
- package/compiled/autoprefixer/postcss/lib/processor.d.ts +5 -4
- 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 +2 -2
- package/compiled/copy-webpack-plugin/576.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 +25 -11
- package/compiled/css-minimizer-webpack-plugin/package.json +1 -1
- package/compiled/css-minimizer-webpack-plugin/utils.js +225 -28
- package/compiled/cssnano/index.js +12 -11
- package/compiled/express/index.js +57 -74
- package/compiled/fork-ts-checker-webpack-plugin/LICENSE +21 -0
- package/compiled/fork-ts-checker-webpack-plugin/fsevents.node +0 -0
- package/compiled/fork-ts-checker-webpack-plugin/index.js +48 -0
- package/compiled/fork-ts-checker-webpack-plugin/package.json +1 -0
- package/compiled/http-proxy-middleware/dist/types.d.ts +5 -5
- package/compiled/http-proxy-middleware/http-proxy/index.d.ts +1 -1
- package/compiled/http-proxy-middleware/index.js +10 -10
- package/compiled/mini-css-extract-plugin/hmr/hotModuleReplacement.js +60 -8
- package/compiled/mini-css-extract-plugin/hmr/normalize-url.js +13 -1
- package/compiled/mini-css-extract-plugin/index.js +8103 -7617
- package/compiled/mini-css-extract-plugin/loader.js +177 -54
- package/compiled/mini-css-extract-plugin/package.json +1 -1
- package/compiled/mini-css-extract-plugin/utils.js +83 -24
- package/compiled/postcss-loader/index.js +1 -1
- package/compiled/react-refresh/index.js +3 -3
- package/compiled/sass-loader/index.js +1 -1
- 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/terser/index.js +1 -1
- package/compiled/terser-webpack-plugin/index.js +393 -517
- 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 +183 -149
- package/compiled/terser-webpack-plugin/types/minify.d.ts +17 -0
- package/compiled/terser-webpack-plugin/types/utils.d.ts +10 -15
- package/compiled/terser-webpack-plugin/utils.js +118 -25
- package/compiled/webpack/index.js +10464 -5286
- package/compiled/webpack-dev-middleware/index.js +11 -5
- package/compiled/webpack-dev-middleware/package.json +1 -1
- package/compiled/webpack-manifest-plugin/LICENSE +21 -0
- 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/ws/index.d.ts +1 -2
- package/compiled/ws/index.js +1 -1
- package/dist/build.d.ts +5 -3
- package/dist/build.js +2 -1
- package/dist/cli.js +4 -7
- package/dist/config/assetRules.js +6 -14
- package/dist/config/compressPlugin.js +6 -0
- package/dist/config/config.d.ts +7 -2
- package/dist/config/config.js +49 -7
- package/dist/config/cssRules.js +1 -1
- package/dist/config/detectDeadCode.d.ts +12 -0
- package/dist/config/detectDeadCode.js +120 -0
- package/dist/config/detectDeadCodePlugin.d.ts +9 -0
- package/dist/config/detectDeadCodePlugin.js +71 -0
- package/dist/config/forkTSCheckerPlugin.d.ts +11 -0
- package/dist/config/forkTSCheckerPlugin.js +34 -0
- package/dist/config/harmonyLinkingErrorPlugin.d.ts +6 -0
- package/dist/config/harmonyLinkingErrorPlugin.js +42 -0
- package/dist/config/javaScriptRules.d.ts +1 -0
- package/dist/config/javaScriptRules.js +31 -20
- package/dist/config/manifestPlugin.d.ts +11 -0
- package/dist/config/manifestPlugin.js +25 -0
- package/dist/config/miniCSSExtractPlugin.d.ts +1 -0
- package/dist/config/miniCSSExtractPlugin.js +2 -3
- package/dist/config/svgRules.d.ts +1 -0
- package/dist/config/svgRules.js +17 -3
- package/dist/constants.d.ts +3 -0
- package/dist/constants.js +4 -1
- package/dist/dev.d.ts +4 -2
- package/dist/dev.js +31 -5
- package/dist/loader/svgr.d.ts +4 -0
- package/dist/loader/svgr.js +67 -0
- package/dist/loader/swc.d.ts +4 -0
- package/dist/loader/swc.js +79 -0
- package/dist/plugins/ParcelCSSMinifyPlugin.d.ts +10 -0
- package/dist/plugins/ParcelCSSMinifyPlugin.js +74 -0
- package/dist/plugins/RuntimePublicPathPlugin.d.ts +4 -0
- package/dist/plugins/RuntimePublicPathPlugin.js +20 -0
- package/dist/requireHook.js +1 -1
- package/dist/schema.js +14 -6
- package/dist/server/server.js +20 -1
- package/dist/swcPlugins/autoCSSModules.d.ts +7 -2
- package/dist/swcPlugins/autoCSSModules.js +13 -16
- package/dist/swcPlugins/lockCoreJS.d.ts +6 -0
- package/dist/swcPlugins/lockCoreJS.js +23 -0
- package/dist/types.d.ts +16 -0
- package/dist/types.js +1 -0
- package/dist/utils/depMatch.js +1 -1
- package/package.json +45 -39
- package/compiled/@svgr/webpack/LICENSE +0 -7
- package/compiled/@svgr/webpack/index.js +0 -266
- package/compiled/@svgr/webpack/package.json +0 -1
- package/compiled/swc-loader/LICENSE +0 -25
- package/compiled/swc-loader/index.js +0 -1
- package/compiled/swc-loader/package.json +0 -1
|
@@ -7,15 +7,23 @@
|
|
|
7
7
|
no-console,
|
|
8
8
|
func-names
|
|
9
9
|
*/
|
|
10
|
+
|
|
11
|
+
/** @typedef {any} TODO */
|
|
10
12
|
var normalizeUrl = require("./normalize-url");
|
|
11
13
|
|
|
12
14
|
var srcByModuleId = Object.create(null);
|
|
13
15
|
var noDocument = typeof document === "undefined";
|
|
14
16
|
var forEach = Array.prototype.forEach;
|
|
17
|
+
/**
|
|
18
|
+
* @param {function} fn
|
|
19
|
+
* @param {number} time
|
|
20
|
+
* @returns {(function(): void)|*}
|
|
21
|
+
*/
|
|
15
22
|
|
|
16
23
|
function debounce(fn, time) {
|
|
17
24
|
var timeout = 0;
|
|
18
25
|
return function () {
|
|
26
|
+
// @ts-ignore
|
|
19
27
|
var self = this; // eslint-disable-next-line prefer-rest-params
|
|
20
28
|
|
|
21
29
|
var args = arguments;
|
|
@@ -24,19 +32,27 @@ function debounce(fn, time) {
|
|
|
24
32
|
return fn.apply(self, args);
|
|
25
33
|
};
|
|
26
34
|
|
|
27
|
-
clearTimeout(timeout);
|
|
35
|
+
clearTimeout(timeout); // @ts-ignore
|
|
36
|
+
|
|
28
37
|
timeout = setTimeout(functionCall, time);
|
|
29
38
|
};
|
|
30
39
|
}
|
|
31
40
|
|
|
32
41
|
function noop() {}
|
|
42
|
+
/**
|
|
43
|
+
* @param {TODO} moduleId
|
|
44
|
+
* @returns {TODO}
|
|
45
|
+
*/
|
|
46
|
+
|
|
33
47
|
|
|
34
48
|
function getCurrentScriptUrl(moduleId) {
|
|
35
49
|
var src = srcByModuleId[moduleId];
|
|
36
50
|
|
|
37
51
|
if (!src) {
|
|
38
52
|
if (document.currentScript) {
|
|
39
|
-
src =
|
|
53
|
+
src =
|
|
54
|
+
/** @type {HTMLScriptElement} */
|
|
55
|
+
document.currentScript.src;
|
|
40
56
|
} else {
|
|
41
57
|
var scripts = document.getElementsByTagName("script");
|
|
42
58
|
var lastScriptTag = scripts[scripts.length - 1];
|
|
@@ -48,6 +64,11 @@ function getCurrentScriptUrl(moduleId) {
|
|
|
48
64
|
|
|
49
65
|
srcByModuleId[moduleId] = src;
|
|
50
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* @param {string} fileMap
|
|
69
|
+
* @returns {null | string[]}
|
|
70
|
+
*/
|
|
71
|
+
|
|
51
72
|
|
|
52
73
|
return function (fileMap) {
|
|
53
74
|
if (!src) {
|
|
@@ -71,6 +92,11 @@ function getCurrentScriptUrl(moduleId) {
|
|
|
71
92
|
});
|
|
72
93
|
};
|
|
73
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* @param {TODO} el
|
|
97
|
+
* @param {string} [url]
|
|
98
|
+
*/
|
|
99
|
+
|
|
74
100
|
|
|
75
101
|
function updateCss(el, url) {
|
|
76
102
|
if (!url) {
|
|
@@ -82,7 +108,9 @@ function updateCss(el, url) {
|
|
|
82
108
|
url = el.href.split("?")[0];
|
|
83
109
|
}
|
|
84
110
|
|
|
85
|
-
if (!isUrlRequest(
|
|
111
|
+
if (!isUrlRequest(
|
|
112
|
+
/** @type {string} */
|
|
113
|
+
url)) {
|
|
86
114
|
return;
|
|
87
115
|
}
|
|
88
116
|
|
|
@@ -124,21 +152,34 @@ function updateCss(el, url) {
|
|
|
124
152
|
el.parentNode.appendChild(newEl);
|
|
125
153
|
}
|
|
126
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* @param {string} href
|
|
157
|
+
* @param {TODO} src
|
|
158
|
+
* @returns {TODO}
|
|
159
|
+
*/
|
|
160
|
+
|
|
127
161
|
|
|
128
162
|
function getReloadUrl(href, src) {
|
|
129
163
|
var ret; // eslint-disable-next-line no-param-reassign
|
|
130
164
|
|
|
131
|
-
href = normalizeUrl(href
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
165
|
+
href = normalizeUrl(href);
|
|
166
|
+
src.some(
|
|
167
|
+
/**
|
|
168
|
+
* @param {string} url
|
|
169
|
+
*/
|
|
170
|
+
// eslint-disable-next-line array-callback-return
|
|
171
|
+
function (url) {
|
|
136
172
|
if (href.indexOf(src) > -1) {
|
|
137
173
|
ret = url;
|
|
138
174
|
}
|
|
139
175
|
});
|
|
140
176
|
return ret;
|
|
141
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* @param {string} [src]
|
|
180
|
+
* @returns {boolean}
|
|
181
|
+
*/
|
|
182
|
+
|
|
142
183
|
|
|
143
184
|
function reloadStyle(src) {
|
|
144
185
|
if (!src) {
|
|
@@ -180,6 +221,11 @@ function reloadAll() {
|
|
|
180
221
|
updateCss(el);
|
|
181
222
|
});
|
|
182
223
|
}
|
|
224
|
+
/**
|
|
225
|
+
* @param {string} url
|
|
226
|
+
* @returns {boolean}
|
|
227
|
+
*/
|
|
228
|
+
|
|
183
229
|
|
|
184
230
|
function isUrlRequest(url) {
|
|
185
231
|
// An URL is not an request if
|
|
@@ -190,6 +236,12 @@ function isUrlRequest(url) {
|
|
|
190
236
|
|
|
191
237
|
return true;
|
|
192
238
|
}
|
|
239
|
+
/**
|
|
240
|
+
* @param {TODO} moduleId
|
|
241
|
+
* @param {TODO} options
|
|
242
|
+
* @returns {TODO}
|
|
243
|
+
*/
|
|
244
|
+
|
|
193
245
|
|
|
194
246
|
module.exports = function (moduleId, options) {
|
|
195
247
|
if (noDocument) {
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @param {string[]} pathComponents
|
|
7
|
+
* @returns {string}
|
|
8
|
+
*/
|
|
4
9
|
function normalizeUrl(pathComponents) {
|
|
5
10
|
return pathComponents.reduce(function (accumulator, item) {
|
|
6
11
|
switch (item) {
|
|
@@ -16,8 +21,15 @@ function normalizeUrl(pathComponents) {
|
|
|
16
21
|
}
|
|
17
22
|
|
|
18
23
|
return accumulator;
|
|
19
|
-
},
|
|
24
|
+
},
|
|
25
|
+
/** @type {string[]} */
|
|
26
|
+
[]).join("/");
|
|
20
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* @param {string} urlString
|
|
30
|
+
* @returns {string}
|
|
31
|
+
*/
|
|
32
|
+
|
|
21
33
|
|
|
22
34
|
module.exports = function (urlString) {
|
|
23
35
|
urlString = urlString.trim();
|