@umijs/bundler-webpack 4.0.0-rc.2 → 4.0.0-rc.22
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 +65 -37
- package/client/constants.js +9 -0
- package/compiled/autoprefixer/browserslist/index.d.ts +2 -0
- package/compiled/autoprefixer/index.js +3 -3
- package/compiled/autoprefixer/postcss/lib/declaration.d.ts +1 -1
- package/compiled/autoprefixer/postcss/lib/node.d.ts +2 -2
- package/compiled/babel-loader/index.js +2 -2
- package/compiled/copy-webpack-plugin/{576.index.js → 939.index.js} +11 -11
- package/compiled/copy-webpack-plugin/index.js +12 -12
- package/compiled/css-minimizer-webpack-plugin/index.js +7 -7
- package/compiled/cssnano/index.js +6 -6
- package/compiled/cssnano/package.json +1 -1
- package/compiled/express.d.ts +2 -0
- package/compiled/fork-ts-checker-webpack-plugin/index.js +7 -13
- package/compiled/http-proxy-middleware/index.js +10 -10
- package/compiled/mini-css-extract-plugin/index.js +440 -401
- package/compiled/mini-css-extract-plugin/loader.js +3 -1
- package/compiled/mini-css-extract-plugin/utils.js +2 -0
- package/compiled/{tapable → react-refresh}/LICENSE +6 -6
- package/compiled/react-refresh/index.js +9 -7
- package/compiled/react-refresh/package.json +1 -0
- package/compiled/terser/index.js +1 -1
- package/compiled/webpack/BasicEffectRulePlugin.js +1 -0
- package/compiled/webpack/BasicMatcherRulePlugin.js +1 -0
- package/compiled/webpack/HotModuleReplacement.runtime.js +29 -14
- package/compiled/webpack/JavascriptHotModuleReplacement.runtime.js +4 -3
- package/compiled/webpack/ObjectMatcherRulePlugin.js +1 -0
- package/compiled/webpack/RuleSetCompiler.js +1 -0
- package/compiled/webpack/UseEffectRulePlugin.js +1 -0
- package/compiled/webpack/deepImports.json +6 -1
- package/compiled/webpack/index.js +5155 -3422
- package/compiled/webpack/types.d.ts +606 -171
- package/compiled/webpack-dev-middleware/index.js +8 -7
- package/compiled/webpack-manifest-plugin/index.js +1 -1
- package/dist/build.d.ts +1 -0
- package/dist/build.js +48 -57
- package/dist/cli.js +6 -15
- package/dist/client/client.js +57 -51
- package/dist/config/_sampleFeature.js +6 -17
- package/dist/config/assetRules.js +44 -55
- package/dist/config/bundleAnalyzerPlugin.js +12 -23
- package/dist/config/compressPlugin.js +89 -64
- package/dist/config/config.d.ts +2 -0
- package/dist/config/config.js +178 -179
- package/dist/config/copyPlugin.js +29 -40
- package/dist/config/cssRules.js +93 -83
- package/dist/config/definePlugin.js +11 -19
- package/dist/config/detectDeadCode.js +1 -1
- package/dist/config/detectDeadCodePlugin.js +21 -22
- package/dist/config/fastRefreshPlugin.js +11 -22
- package/dist/config/forkTSCheckerPlugin.js +11 -22
- package/dist/config/harmonyLinkingErrorPlugin.js +3 -14
- package/dist/config/ignorePlugin.js +10 -21
- package/dist/config/javaScriptRules.d.ts +1 -0
- package/dist/config/javaScriptRules.js +152 -138
- package/dist/config/manifestPlugin.js +10 -18
- package/dist/config/miniCSSExtractPlugin.js +12 -23
- package/dist/config/nodePolyfill.js +14 -20
- package/dist/config/nodePrefixPlugin.d.ts +11 -0
- package/dist/config/nodePrefixPlugin.js +14 -0
- package/dist/config/progressPlugin.js +7 -18
- package/dist/config/purgecssWebpackPlugin.js +15 -26
- package/dist/config/speedMeasureWebpackPlugin.js +12 -23
- package/dist/config/svgRules.js +44 -47
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +7 -1
- package/dist/dev.d.ts +4 -0
- package/dist/dev.js +115 -94
- package/dist/index.d.ts +4 -1
- package/dist/index.js +5 -1
- package/dist/loader/svgr.js +4 -13
- package/dist/loader/swc.js +9 -14
- package/dist/plugins/ProgressPlugin.js +2 -2
- package/dist/plugins/RuntimePublicPathPlugin.js +4 -1
- package/dist/schema.js +29 -13
- package/dist/server/server.d.ts +3 -1
- package/dist/server/server.js +166 -148
- package/dist/server/ws.d.ts +7 -2
- package/dist/swcPlugins/autoCSSModules.js +3 -1
- package/dist/swcPlugins/changeImportFromString.d.ts +2 -0
- package/dist/swcPlugins/changeImportFromString.js +10 -0
- package/dist/swcPlugins/lockCoreJS.d.ts +1 -1
- package/dist/swcPlugins/lockCoreJS.js +3 -2
- package/dist/types.d.ts +4 -0
- package/dist/types.js +1 -0
- package/dist/utils/getEsBuildTarget.d.ts +5 -0
- package/dist/utils/getEsBuildTarget.js +12 -0
- package/package.json +33 -35
- package/compiled/css-loader/LICENSE +0 -20
- 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/LICENSE +0 -24
- 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 -321
- 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/less/index.js +0 -31
- package/compiled/less/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/plugins/ESBuildCSSMinifyPlugin.d.ts +0 -11
- package/dist/plugins/ESBuildCSSMinifyPlugin.js +0 -65
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./').BasicEffectRulePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./').BasicMatcherRulePlugin;
|
|
@@ -28,7 +28,8 @@ module.exports = function () {
|
|
|
28
28
|
var currentStatus = "idle";
|
|
29
29
|
|
|
30
30
|
// while downloading
|
|
31
|
-
var blockingPromises;
|
|
31
|
+
var blockingPromises = 0;
|
|
32
|
+
var blockingPromisesWaiting = [];
|
|
32
33
|
|
|
33
34
|
// The update info
|
|
34
35
|
var currentUpdateApplyHandlers;
|
|
@@ -218,17 +219,28 @@ module.exports = function () {
|
|
|
218
219
|
return Promise.all(results);
|
|
219
220
|
}
|
|
220
221
|
|
|
222
|
+
function unblock() {
|
|
223
|
+
if (--blockingPromises === 0) {
|
|
224
|
+
setStatus("ready").then(function () {
|
|
225
|
+
if (blockingPromises === 0) {
|
|
226
|
+
var list = blockingPromisesWaiting;
|
|
227
|
+
blockingPromisesWaiting = [];
|
|
228
|
+
for (var i = 0; i < list.length; i++) {
|
|
229
|
+
list[i]();
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
221
236
|
function trackBlockingPromise(promise) {
|
|
222
237
|
switch (currentStatus) {
|
|
223
238
|
case "ready":
|
|
224
239
|
setStatus("prepare");
|
|
225
|
-
|
|
226
|
-
waitForBlockingPromises(function () {
|
|
227
|
-
return setStatus("ready");
|
|
228
|
-
});
|
|
229
|
-
return promise;
|
|
240
|
+
/* fallthrough */
|
|
230
241
|
case "prepare":
|
|
231
|
-
blockingPromises
|
|
242
|
+
blockingPromises++;
|
|
243
|
+
promise.then(unblock, unblock);
|
|
232
244
|
return promise;
|
|
233
245
|
default:
|
|
234
246
|
return promise;
|
|
@@ -236,11 +248,11 @@ module.exports = function () {
|
|
|
236
248
|
}
|
|
237
249
|
|
|
238
250
|
function waitForBlockingPromises(fn) {
|
|
239
|
-
if (blockingPromises
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
251
|
+
if (blockingPromises === 0) return fn();
|
|
252
|
+
return new Promise(function (resolve) {
|
|
253
|
+
blockingPromisesWaiting.push(function () {
|
|
254
|
+
resolve(fn());
|
|
255
|
+
});
|
|
244
256
|
});
|
|
245
257
|
}
|
|
246
258
|
|
|
@@ -261,7 +273,6 @@ module.exports = function () {
|
|
|
261
273
|
|
|
262
274
|
return setStatus("prepare").then(function () {
|
|
263
275
|
var updatedModules = [];
|
|
264
|
-
blockingPromises = [];
|
|
265
276
|
currentUpdateApplyHandlers = [];
|
|
266
277
|
|
|
267
278
|
return Promise.all(
|
|
@@ -298,7 +309,11 @@ module.exports = function () {
|
|
|
298
309
|
function hotApply(options) {
|
|
299
310
|
if (currentStatus !== "ready") {
|
|
300
311
|
return Promise.resolve().then(function () {
|
|
301
|
-
throw new Error(
|
|
312
|
+
throw new Error(
|
|
313
|
+
"apply() is only allowed in ready status (state: " +
|
|
314
|
+
currentStatus +
|
|
315
|
+
")"
|
|
316
|
+
);
|
|
302
317
|
});
|
|
303
318
|
}
|
|
304
319
|
return internalApply(options);
|
|
@@ -443,15 +443,16 @@ module.exports = function () {
|
|
|
443
443
|
) {
|
|
444
444
|
promises.push($loadUpdateChunk$(chunkId, updatedModulesList));
|
|
445
445
|
currentUpdateChunks[chunkId] = true;
|
|
446
|
+
} else {
|
|
447
|
+
currentUpdateChunks[chunkId] = false;
|
|
446
448
|
}
|
|
447
449
|
});
|
|
448
450
|
if ($ensureChunkHandlers$) {
|
|
449
451
|
$ensureChunkHandlers$.$key$Hmr = function (chunkId, promises) {
|
|
450
452
|
if (
|
|
451
453
|
currentUpdateChunks &&
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
$installedChunks$[chunkId] !== undefined
|
|
454
|
+
$hasOwnProperty$(currentUpdateChunks, chunkId) &&
|
|
455
|
+
!currentUpdateChunks[chunkId]
|
|
455
456
|
) {
|
|
456
457
|
promises.push($loadUpdateChunk$(chunkId));
|
|
457
458
|
currentUpdateChunks[chunkId] = true;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./').ObjectMatcherRulePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./').RuleSetCompiler;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./').UseEffectRulePlugin;
|
|
@@ -8,5 +8,10 @@
|
|
|
8
8
|
"webpack/lib/RuntimeGlobals",
|
|
9
9
|
"webpack/lib/RuntimeModule",
|
|
10
10
|
"webpack/lib/SingleEntryPlugin",
|
|
11
|
-
"webpack/lib/Template"
|
|
11
|
+
"webpack/lib/Template",
|
|
12
|
+
"webpack/lib/rules/BasicEffectRulePlugin",
|
|
13
|
+
"webpack/lib/rules/BasicMatcherRulePlugin",
|
|
14
|
+
"webpack/lib/rules/ObjectMatcherRulePlugin",
|
|
15
|
+
"webpack/lib/rules/RuleSetCompiler",
|
|
16
|
+
"webpack/lib/rules/UseEffectRulePlugin"
|
|
12
17
|
]
|