@umijs/bundler-webpack 4.0.0-rc.9 → 4.0.0
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/css-minimizer-webpack-plugin/index.js +7 -7
- package/compiled/cssnano/index.js +6 -6
- package/compiled/fork-ts-checker-webpack-plugin/index.js +7 -13
- 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/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 +3978 -3167
- 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 +49 -56
- package/dist/cli.js +6 -15
- package/dist/client/client.js +52 -50
- 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 -70
- package/dist/config/config.d.ts +2 -0
- package/dist/config/config.js +181 -179
- package/dist/config/copyPlugin.js +29 -40
- package/dist/config/cssRules.js +114 -83
- package/dist/config/definePlugin.js +11 -19
- package/dist/config/detectDeadCodePlugin.js +16 -21
- 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 -136
- package/dist/config/manifestPlugin.d.ts +1 -1
- package/dist/config/manifestPlugin.js +10 -18
- package/dist/config/miniCSSExtractPlugin.js +15 -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/ssrPlugin.d.ts +11 -0
- package/dist/config/ssrPlugin.js +66 -0
- 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 +113 -93
- package/dist/index.d.ts +3 -0
- package/dist/index.js +16 -0
- package/dist/loader/svgr.js +4 -13
- package/dist/loader/swc.js +9 -14
- package/dist/plugins/ProgressPlugin.js +3 -3
- package/dist/plugins/RuntimePublicPathPlugin.js +4 -1
- package/dist/schema.js +21 -6
- package/dist/server/server.d.ts +3 -1
- package/dist/server/server.js +165 -159
- package/dist/server/ws.d.ts +7 -2
- package/dist/types.d.ts +3 -0
- package/dist/utils/getEsBuildTarget.d.ts +5 -0
- package/dist/utils/getEsBuildTarget.js +12 -0
- package/package.json +22 -20
- 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 -63
- package/dist/plugins/ParcelCSSMinifyPlugin.d.ts +0 -10
- package/dist/plugins/ParcelCSSMinifyPlugin.js +0 -75
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright
|
|
3
|
+
Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
9
9
|
copies of the Software, and to permit persons to whom the Software is
|
|
10
10
|
furnished to do so, subject to the following conditions:
|
|
11
11
|
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
14
|
|
|
15
15
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
16
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
17
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
(function(){"use strict";var e={
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
1
|
+
(function(){"use strict";var e={653:function(e,t){
|
|
2
|
+
/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react-refresh-runtime.development.js
|
|
4
5
|
*
|
|
5
6
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
7
|
*
|
|
7
8
|
* This source code is licensed under the MIT license found in the
|
|
8
9
|
* LICENSE file in the root directory of this source tree.
|
|
9
10
|
*/
|
|
10
|
-
if(process.env.NODE_ENV!=="production"){(function(){"use strict";
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
11
|
+
if(process.env.NODE_ENV!=="production"){(function(){"use strict";var e=Symbol.for("react.forward_ref");var r=Symbol.for("react.memo");var n=typeof WeakMap==="function"?WeakMap:Map;var o=new Map;var i=new n;var a=new n;var u=new n;var f=[];var s=new Map;var c=new Map;var l=new Set;var d=new Set;var p=typeof WeakMap==="function"?new WeakMap:null;var y=false;function computeFullKey(e){if(e.fullKey!==null){return e.fullKey}var t=e.ownKey;var r;try{r=e.getCustomHooks()}catch(r){e.forceReset=true;e.fullKey=t;return t}for(var n=0;n<r.length;n++){var o=r[n];if(typeof o!=="function"){e.forceReset=true;e.fullKey=t;return t}var i=a.get(o);if(i===undefined){continue}var u=computeFullKey(i);if(i.forceReset){e.forceReset=true}t+="\n---\n"+u}e.fullKey=t;return t}function haveEqualSignatures(e,t){var r=a.get(e);var n=a.get(t);if(r===undefined&&n===undefined){return true}if(r===undefined||n===undefined){return false}if(computeFullKey(r)!==computeFullKey(n)){return false}if(n.forceReset){return false}return true}function isReactClass(e){return e.prototype&&e.prototype.isReactComponent}function canPreserveStateBetween(e,t){if(isReactClass(e)||isReactClass(t)){return false}if(haveEqualSignatures(e,t)){return true}return false}function resolveFamily(e){return u.get(e)}function cloneMap(e){var t=new Map;e.forEach((function(e,r){t.set(r,e)}));return t}function cloneSet(e){var t=new Set;e.forEach((function(e){t.add(e)}));return t}function getProperty(e,t){try{return e[t]}catch(e){return undefined}}function performReactRefresh(){if(f.length===0){return null}if(y){return null}y=true;try{var e=new Set;var t=new Set;var r=f;f=[];r.forEach((function(r){var n=r[0],o=r[1];var i=n.current;u.set(i,n);u.set(o,n);n.current=o;if(canPreserveStateBetween(i,o)){t.add(n)}else{e.add(n)}}));var n={updatedFamilies:t,staleFamilies:e};s.forEach((function(e){e.setRefreshHandler(resolveFamily)}));var o=false;var i=null;var a=cloneSet(d);var h=cloneSet(l);var v=cloneMap(c);a.forEach((function(e){var t=v.get(e);if(t===undefined){throw new Error("Could not find helpers for a root. This is a bug in React Refresh.")}if(!d.has(e)){}if(p===null){return}if(!p.has(e)){return}var r=p.get(e);try{t.scheduleRoot(e,r)}catch(e){if(!o){o=true;i=e}}}));h.forEach((function(e){var t=v.get(e);if(t===undefined){throw new Error("Could not find helpers for a root. This is a bug in React Refresh.")}if(!l.has(e)){}try{t.scheduleRefresh(e,n)}catch(e){if(!o){o=true;i=e}}}));if(o){throw i}return n}finally{y=false}}function register(t,n){{if(t===null){return}if(typeof t!=="function"&&typeof t!=="object"){return}if(i.has(t)){return}var a=o.get(n);if(a===undefined){a={current:t};o.set(n,a)}else{f.push([a,t])}i.set(t,a);if(typeof t==="object"&&t!==null){switch(getProperty(t,"$$typeof")){case e:register(t.render,n+"$render");break;case r:register(t.type,n+"$type");break}}}}function setSignature(t,n){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var i=arguments.length>3?arguments[3]:undefined;{if(!a.has(t)){a.set(t,{forceReset:o,ownKey:n,fullKey:null,getCustomHooks:i||function(){return[]}})}if(typeof t==="object"&&t!==null){switch(getProperty(t,"$$typeof")){case e:setSignature(t.render,n,o,i);break;case r:setSignature(t.type,n,o,i);break}}}}function collectCustomHooksForSignature(e){{var t=a.get(e);if(t!==undefined){computeFullKey(t)}}}function getFamilyByID(e){{return o.get(e)}}function getFamilyByType(e){{return i.get(e)}}function findAffectedHostInstances(e){{var t=new Set;l.forEach((function(r){var n=c.get(r);if(n===undefined){throw new Error("Could not find helpers for a root. This is a bug in React Refresh.")}var o=n.findHostInstancesForRefresh(r,e);o.forEach((function(e){t.add(e)}))}));return t}}function injectIntoGlobalHook(e){{var t=e.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t===undefined){var r=0;e.__REACT_DEVTOOLS_GLOBAL_HOOK__=t={renderers:new Map,supportsFiber:true,inject:function(e){return r++},onScheduleFiberRoot:function(e,t,r){},onCommitFiberRoot:function(e,t,r,n){},onCommitFiberUnmount:function(){}}}if(t.isDisabled){console["warn"]("Something has shimmed the React DevTools global hook (__REACT_DEVTOOLS_GLOBAL_HOOK__). "+"Fast Refresh is not compatible with this shim and will be disabled.");return}var n=t.inject;t.inject=function(e){var t=n.apply(this,arguments);if(typeof e.scheduleRefresh==="function"&&typeof e.setRefreshHandler==="function"){s.set(t,e)}return t};t.renderers.forEach((function(e,t){if(typeof e.scheduleRefresh==="function"&&typeof e.setRefreshHandler==="function"){s.set(t,e)}}));var o=t.onCommitFiberRoot;var i=t.onScheduleFiberRoot||function(){};t.onScheduleFiberRoot=function(e,t,r){if(!y){d.delete(t);if(p!==null){p.set(t,r)}}return i.apply(this,arguments)};t.onCommitFiberRoot=function(e,t,r,n){var i=s.get(e);if(i!==undefined){c.set(t,i);var a=t.current;var u=a.alternate;if(u!==null){var f=u.memoizedState!=null&&u.memoizedState.element!=null&&l.has(t);var p=a.memoizedState!=null&&a.memoizedState.element!=null;if(!f&&p){l.add(t);d.delete(t)}else if(f&&p);else if(f&&!p){l.delete(t);if(n){d.add(t)}else{c.delete(t)}}else if(!f&&!p){if(n){d.add(t)}}}else{l.add(t)}}return o.apply(this,arguments)}}}function hasUnrecoverableErrors(){return false}function _getMountedRootCount(){{return l.size}}function createSignatureFunctionForTransform(){{var e;var t;var r=false;return function(n,o,i,a){if(typeof o==="string"){if(!e){e=n;t=typeof a==="function"}if(n!=null&&(typeof n==="function"||typeof n==="object")){setSignature(n,o,i,a)}return n}else{if(!r&&t){r=true;collectCustomHooksForSignature(e)}}}}}function isLikelyComponentType(t){{switch(typeof t){case"function":{if(t.prototype!=null){if(t.prototype.isReactComponent){return true}var n=Object.getOwnPropertyNames(t.prototype);if(n.length>1||n[0]!=="constructor"){return false}if(t.prototype.__proto__!==Object.prototype){return false}}var o=t.name||t.displayName;return typeof o==="string"&&/^[A-Z]/.test(o)}case"object":{if(t!=null){switch(getProperty(t,"$$typeof")){case e:case r:return true;default:return false}}return false}default:{return false}}}}t._getMountedRootCount=_getMountedRootCount;t.collectCustomHooksForSignature=collectCustomHooksForSignature;t.createSignatureFunctionForTransform=createSignatureFunctionForTransform;t.findAffectedHostInstances=findAffectedHostInstances;t.getFamilyByID=getFamilyByID;t.getFamilyByType=getFamilyByType;t.hasUnrecoverableErrors=hasUnrecoverableErrors;t.injectIntoGlobalHook=injectIntoGlobalHook;t.isLikelyComponentType=isLikelyComponentType;t.performReactRefresh=performReactRefresh;t.register=register;t.setSignature=setSignature})()}},665:function(){
|
|
12
|
+
/**
|
|
13
|
+
* @license React
|
|
14
|
+
* react-refresh-runtime.production.min.js
|
|
13
15
|
*
|
|
14
16
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
17
|
*
|
|
16
18
|
* This source code is licensed under the MIT license found in the
|
|
17
19
|
* LICENSE file in the root directory of this source tree.
|
|
18
20
|
*/
|
|
19
|
-
|
|
21
|
+
throw Error("React Refresh runtime should not be included in the production bundle.")},999:function(e,t,r){if(process.env.NODE_ENV==="production"){e.exports=r(665)}else{e.exports=r(653)}}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var o=t[r]={exports:{}};var i=true;try{e[r](o,o.exports,__nccwpck_require__);i=false}finally{if(i)delete t[r]}return o.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(999);module.exports=r})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"react-refresh","license":"MIT"}
|
|
@@ -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
|
]
|