@umijs/bundler-webpack 4.0.0-rc.1 → 4.0.0-rc.12

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.
Files changed (121) hide show
  1. package/client/client/client.js +57 -37
  2. package/client/constants.js +9 -0
  3. package/compiled/autoprefixer/browserslist/index.d.ts +6 -0
  4. package/compiled/autoprefixer/index.js +3 -3
  5. package/compiled/autoprefixer/postcss/lib/at-rule.d.ts +1 -1
  6. package/compiled/autoprefixer/postcss/lib/comment.d.ts +1 -1
  7. package/compiled/autoprefixer/postcss/lib/declaration.d.ts +2 -2
  8. package/compiled/autoprefixer/postcss/lib/node.d.ts +2 -2
  9. package/compiled/autoprefixer/postcss/lib/rule.d.ts +1 -1
  10. package/compiled/autoprefixer/source-map-js/source-map.d.ts +99 -82
  11. package/compiled/babel-loader/index.js +2 -2
  12. package/compiled/copy-webpack-plugin/939.index.js +1171 -0
  13. package/compiled/copy-webpack-plugin/index.js +16 -10
  14. package/compiled/copy-webpack-plugin/package.json +1 -1
  15. package/compiled/css-minimizer-webpack-plugin/index.js +8 -2
  16. package/compiled/css-minimizer-webpack-plugin/minify.js +25 -11
  17. package/compiled/css-minimizer-webpack-plugin/package.json +1 -1
  18. package/compiled/css-minimizer-webpack-plugin/utils.js +225 -28
  19. package/compiled/cssnano/index.js +12 -11
  20. package/compiled/cssnano/package.json +1 -1
  21. package/compiled/express.d.ts +2 -0
  22. package/compiled/fork-ts-checker-webpack-plugin/index.js +8 -15
  23. package/compiled/http-proxy-middleware/dist/types.d.ts +5 -5
  24. package/compiled/http-proxy-middleware/http-proxy/index.d.ts +1 -1
  25. package/compiled/http-proxy-middleware/index.js +10 -10
  26. package/compiled/mini-css-extract-plugin/hmr/hotModuleReplacement.js +60 -8
  27. package/compiled/mini-css-extract-plugin/hmr/normalize-url.js +13 -1
  28. package/compiled/mini-css-extract-plugin/index.js +4523 -4036
  29. package/compiled/mini-css-extract-plugin/loader.js +179 -54
  30. package/compiled/mini-css-extract-plugin/package.json +1 -1
  31. package/compiled/mini-css-extract-plugin/utils.js +79 -23
  32. package/compiled/react-refresh/LICENSE +21 -0
  33. package/compiled/react-refresh/index.js +9 -7
  34. package/compiled/react-refresh/package.json +1 -0
  35. package/compiled/sass-loader/index.js +1 -1
  36. package/compiled/terser/index.js +1 -1
  37. package/compiled/terser-webpack-plugin/index.js +296 -297
  38. package/compiled/terser-webpack-plugin/minify.js +4 -2
  39. package/compiled/terser-webpack-plugin/package.json +1 -1
  40. package/compiled/terser-webpack-plugin/types/index.d.ts +180 -146
  41. package/compiled/terser-webpack-plugin/types/minify.d.ts +17 -0
  42. package/compiled/terser-webpack-plugin/types/utils.d.ts +1 -3
  43. package/compiled/terser-webpack-plugin/utils.js +9 -12
  44. package/compiled/webpack/HotModuleReplacement.runtime.js +29 -14
  45. package/compiled/webpack/JavascriptHotModuleReplacement.runtime.js +4 -3
  46. package/compiled/webpack/index.js +11589 -4372
  47. package/compiled/webpack-dev-middleware/index.js +7 -7
  48. package/compiled/webpack-dev-middleware/package.json +1 -1
  49. package/compiled/webpack-manifest-plugin/index.js +1 -1
  50. package/compiled/webpack-sources/index.js +1 -1
  51. package/compiled/ws/index.d.ts +1 -2
  52. package/compiled/ws/index.js +1 -1
  53. package/dist/build.d.ts +2 -1
  54. package/dist/build.js +1 -1
  55. package/dist/client/client.js +15 -4
  56. package/dist/config/compressPlugin.js +15 -1
  57. package/dist/config/config.js +7 -3
  58. package/dist/config/cssRules.js +1 -1
  59. package/dist/config/detectDeadCode.d.ts +12 -0
  60. package/dist/config/detectDeadCode.js +120 -0
  61. package/dist/config/detectDeadCodePlugin.d.ts +9 -0
  62. package/dist/config/detectDeadCodePlugin.js +75 -0
  63. package/dist/config/javaScriptRules.js +7 -12
  64. package/dist/config/nodePolyfill.js +1 -1
  65. package/dist/config/nodePrefixPlugin.d.ts +11 -0
  66. package/dist/config/nodePrefixPlugin.js +25 -0
  67. package/dist/constants.d.ts +4 -0
  68. package/dist/constants.js +10 -1
  69. package/dist/dev.d.ts +4 -0
  70. package/dist/dev.js +27 -8
  71. package/dist/index.d.ts +4 -1
  72. package/dist/index.js +5 -1
  73. package/dist/loader/swc.js +14 -18
  74. package/dist/plugins/ESBuildCSSMinifyPlugin.js +1 -3
  75. package/dist/plugins/ParcelCSSMinifyPlugin.d.ts +10 -0
  76. package/dist/plugins/ParcelCSSMinifyPlugin.js +75 -0
  77. package/dist/plugins/ProgressPlugin.js +2 -2
  78. package/dist/plugins/RuntimePublicPathPlugin.js +1 -1
  79. package/dist/requireHook.js +1 -1
  80. package/dist/schema.js +10 -6
  81. package/dist/server/https.d.ts +5 -0
  82. package/dist/server/https.js +73 -0
  83. package/dist/server/server.d.ts +2 -1
  84. package/dist/server/server.js +48 -11
  85. package/dist/server/ws.d.ts +3 -2
  86. package/dist/swcPlugins/autoCSSModules.d.ts +7 -2
  87. package/dist/swcPlugins/autoCSSModules.js +14 -17
  88. package/dist/swcPlugins/changeImportFromString.d.ts +2 -0
  89. package/dist/swcPlugins/changeImportFromString.js +10 -0
  90. package/dist/swcPlugins/lockCoreJS.d.ts +1 -1
  91. package/dist/swcPlugins/lockCoreJS.js +3 -2
  92. package/dist/types.d.ts +16 -12
  93. package/dist/types.js +1 -0
  94. package/dist/utils/depMatch.js +1 -1
  95. package/dist/utils/getEsBuildTarget.d.ts +5 -0
  96. package/dist/utils/getEsBuildTarget.js +12 -0
  97. package/package.json +40 -42
  98. package/compiled/css-loader/LICENSE +0 -20
  99. package/compiled/css-loader/api.js +0 -102
  100. package/compiled/css-loader/getUrl.js +0 -29
  101. package/compiled/css-loader/index.js +0 -2
  102. package/compiled/css-loader/noSourceMaps.js +0 -5
  103. package/compiled/css-loader/package.json +0 -1
  104. package/compiled/css-loader/sourceMaps.js +0 -22
  105. package/compiled/express/LICENSE +0 -24
  106. package/compiled/express/body-parser/index.d.ts +0 -104
  107. package/compiled/express/connect/index.d.ts +0 -93
  108. package/compiled/express/express-serve-static-core/index.d.ts +0 -1252
  109. package/compiled/express/index.d.ts +0 -133
  110. package/compiled/express/index.js +0 -338
  111. package/compiled/express/mime/index.d.ts +0 -35
  112. package/compiled/express/package.json +0 -1
  113. package/compiled/express/qs/index.d.ts +0 -62
  114. package/compiled/express/range-parser/index.d.ts +0 -35
  115. package/compiled/express/serve-static/index.d.ts +0 -108
  116. package/compiled/less/index.js +0 -31
  117. package/compiled/less/package.json +0 -1
  118. package/dist/esbuildHandler/autoCssModules.d.ts +0 -2
  119. package/dist/esbuildHandler/autoCssModules.js +0 -23
  120. package/dist/loader/esbuild.d.ts +0 -5
  121. package/dist/loader/esbuild.js +0 -53
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/bundler-webpack",
3
- "version": "4.0.0-rc.1",
3
+ "version": "4.0.0-rc.12",
4
4
  "description": "@umijs/bundler-webpack",
5
5
  "homepage": "https://github.com/umijs/umi-next/tree/master/packages/bundler-webpack#readme",
6
6
  "bugs": "https://github.com/umijs/umi-next/issues",
@@ -25,63 +25,63 @@
25
25
  "build:client": "pnpm tsc --project ./tsconfig.client.json",
26
26
  "build:deps": "pnpm esno ../../scripts/bundleDeps.ts",
27
27
  "dev": "pnpm build -- --watch",
28
- "generate:webpackPackages": "zx ./scripts/generateWebpackPackages.mjs"
28
+ "generate:webpackPackages": "zx ./scripts/generateWebpackPackages.mjs",
29
+ "test": "jest -c ../../jest.turbo.config.ts"
29
30
  },
30
31
  "dependencies": {
31
- "@pmmmwh/react-refresh-webpack-plugin": "0.5.3",
32
- "@svgr/core": "6.0.0",
33
- "@svgr/plugin-jsx": "^6.1.0",
34
- "@svgr/plugin-svgo": "^6.1.0",
35
- "@swc/core": "1.2.117",
36
- "@types/hapi__joi": "17.1.7",
37
- "@umijs/babel-preset-umi": "4.0.0-rc.1",
38
- "@umijs/mfsu": "4.0.0-rc.1",
39
- "@umijs/utils": "4.0.0-rc.1",
40
- "css-loader": "6.5.1",
32
+ "@parcel/css": "1.8.1",
33
+ "@pmmmwh/react-refresh-webpack-plugin": "0.5.5",
34
+ "@svgr/core": "6.2.1",
35
+ "@svgr/plugin-jsx": "^6.2.1",
36
+ "@svgr/plugin-svgo": "^6.2.0",
37
+ "@types/hapi__joi": "17.1.8",
38
+ "@umijs/babel-preset-umi": "4.0.0-rc.12",
39
+ "@umijs/bundler-utils": "4.0.0-rc.12",
40
+ "@umijs/mfsu": "4.0.0-rc.12",
41
+ "@umijs/utils": "4.0.0-rc.12",
42
+ "css-loader": "6.7.1",
41
43
  "es5-imcompatible-versions": "^0.1.73",
42
- "jest-worker": "27.4.2",
44
+ "jest-worker": "27.5.1",
43
45
  "node-libs-browser": "2.2.1",
44
- "postcss": "^8.4.4",
45
- "postcss-preset-env": "7.0.1",
46
+ "postcss": "^8.4.12",
47
+ "postcss-preset-env": "7.4.3",
46
48
  "react-error-overlay": "6.0.9"
47
49
  },
48
50
  "devDependencies": {
49
- "@types/express": "4.17.13",
51
+ "@swc/core": "1.2.165",
50
52
  "@types/webpack-sources": "3.2.0",
51
- "@types/ws": "8.2.1",
52
- "autoprefixer": "10.4.0",
53
- "babel-loader": "8.2.3",
53
+ "@types/ws": "8.5.3",
54
+ "autoprefixer": "10.4.4",
55
+ "babel-loader": "8.2.4",
54
56
  "compression": "1.7.4",
55
57
  "connect-history-api-fallback": "1.6.0",
56
- "copy-webpack-plugin": "9.0.1",
57
- "css-minimizer-webpack-plugin": "3.1.1",
58
- "cssnano": "5.0.8",
59
- "express": "4.17.1",
60
- "fork-ts-checker-webpack-plugin": "6.5.0",
61
- "http-proxy-middleware": "2.0.1",
62
- "less": "4.1.2",
58
+ "copy-webpack-plugin": "10.2.4",
59
+ "css-minimizer-webpack-plugin": "3.4.1",
60
+ "cssnano": "5.1.7",
61
+ "fork-ts-checker-webpack-plugin": "7.2.4",
62
+ "http-proxy-middleware": "2.0.4",
63
63
  "less-loader": "10.2.0",
64
- "mini-css-extract-plugin": "2.4.5",
64
+ "mini-css-extract-plugin": "2.6.0",
65
65
  "postcss-flexbugs-fixes": "5.0.2",
66
66
  "postcss-loader": "6.2.1",
67
- "purgecss-webpack-plugin": "4.0.3",
68
- "react-refresh": "0.11.0",
69
- "sass-loader": "12.3.0",
67
+ "purgecss-webpack-plugin": "4.1.3",
68
+ "react-refresh": "0.12.0",
69
+ "sass-loader": "12.6.0",
70
70
  "schema-utils": "4.0.0",
71
71
  "speed-measure-webpack-plugin": "1.5.0",
72
72
  "style-loader": "3.3.1",
73
73
  "svgo-loader": "3.0.0",
74
74
  "tapable": "2.2.1",
75
- "terser": "5.10.0",
76
- "terser-webpack-plugin": "5.2.5",
75
+ "terser": "5.12.1",
76
+ "terser-webpack-plugin": "5.3.1",
77
77
  "url-loader": "4.1.1",
78
- "webpack": "5.64.4",
78
+ "webpack": "5.72.0",
79
79
  "webpack-5-chain": "8.0.0",
80
80
  "webpack-bundle-analyzer": "4.5.0",
81
- "webpack-dev-middleware": "5.2.2",
82
- "webpack-manifest-plugin": "4.0.2",
83
- "webpack-sources": "3.2.2",
84
- "ws": "8.2.3"
81
+ "webpack-dev-middleware": "5.3.1",
82
+ "webpack-manifest-plugin": "5.0.0",
83
+ "webpack-sources": "3.2.3",
84
+ "ws": "8.5.0"
85
85
  },
86
86
  "publishConfig": {
87
87
  "access": "public"
@@ -99,10 +99,8 @@
99
99
  "cssnano",
100
100
  "compression",
101
101
  "connect-history-api-fallback",
102
- "express",
103
102
  "fork-ts-checker-webpack-plugin",
104
103
  "http-proxy-middleware",
105
- "less",
106
104
  "less-loader",
107
105
  "mini-css-extract-plugin",
108
106
  "postcss-flexbugs-fixes",
@@ -131,9 +129,9 @@
131
129
  "@babel/core": "@umijs/bundler-utils/compiled/babel/core",
132
130
  "es-module-lexer": "@umijs/bundler-utils/compiled/es-module-lexer",
133
131
  "esbuild": "@umijs/bundler-utils/compiled/esbuild",
134
- "express": "$$LOCAL",
132
+ "express": "@umijs/bundler-utils/compiled/express",
135
133
  "jest-worker": "jest-worker",
136
- "less": "$$LOCAL",
134
+ "less": "@umijs/bundler-utils/compiled/less",
137
135
  "cssnano": "$$LOCAL",
138
136
  "postcss": "postcss",
139
137
  "tapable": "$$LOCAL",
@@ -172,12 +170,12 @@
172
170
  "compression",
173
171
  "connect-history-api-fallback",
174
172
  "fork-ts-checker-webpack-plugin",
175
- "less",
176
173
  "less-loader",
177
174
  "mini-css-extract-plugin",
178
175
  "postcss-flexbugs-fixes",
179
176
  "postcss-loader",
180
177
  "purgecss-webpack-plugin",
178
+ "react-refresh",
181
179
  "sass-loader",
182
180
  "speed-measure-webpack-plugin",
183
181
  "style-loader",
@@ -1,20 +0,0 @@
1
- Copyright JS Foundation and other contributors
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- 'Software'), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,102 +0,0 @@
1
- "use strict";
2
-
3
- /*
4
- MIT License http://www.opensource.org/licenses/mit-license.php
5
- Author Tobias Koppers @sokra
6
- */
7
- module.exports = function (cssWithMappingToString) {
8
- var list = []; // return the list of modules as css string
9
-
10
- list.toString = function toString() {
11
- return this.map(function (item) {
12
- var content = "";
13
- var needLayer = typeof item[5] !== "undefined";
14
-
15
- if (item[4]) {
16
- content += "@supports (".concat(item[4], ") {");
17
- }
18
-
19
- if (item[2]) {
20
- content += "@media ".concat(item[2], " {");
21
- }
22
-
23
- if (needLayer) {
24
- content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
25
- }
26
-
27
- content += cssWithMappingToString(item);
28
-
29
- if (needLayer) {
30
- content += "}";
31
- }
32
-
33
- if (item[2]) {
34
- content += "}";
35
- }
36
-
37
- if (item[4]) {
38
- content += "}";
39
- }
40
-
41
- return content;
42
- }).join("");
43
- }; // import a list of modules into the list
44
-
45
-
46
- list.i = function i(modules, media, dedupe, supports, layer) {
47
- if (typeof modules === "string") {
48
- modules = [[null, modules, undefined]];
49
- }
50
-
51
- var alreadyImportedModules = {};
52
-
53
- if (dedupe) {
54
- for (var _i = 0; _i < this.length; _i++) {
55
- var id = this[_i][0];
56
-
57
- if (id != null) {
58
- alreadyImportedModules[id] = true;
59
- }
60
- }
61
- }
62
-
63
- for (var _i2 = 0; _i2 < modules.length; _i2++) {
64
- var item = [].concat(modules[_i2]);
65
-
66
- if (dedupe && alreadyImportedModules[item[0]]) {
67
- continue;
68
- }
69
-
70
- if (typeof layer !== "undefined") {
71
- if (typeof item[5] === "undefined") {
72
- item[5] = layer;
73
- } else {
74
- item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
75
- item[5] = layer;
76
- }
77
- }
78
-
79
- if (media) {
80
- if (!item[2]) {
81
- item[2] = media;
82
- } else {
83
- item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
84
- item[2] = media;
85
- }
86
- }
87
-
88
- if (supports) {
89
- if (!item[4]) {
90
- item[4] = "".concat(supports);
91
- } else {
92
- item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
93
- item[4] = supports;
94
- }
95
- }
96
-
97
- list.push(item);
98
- }
99
- };
100
-
101
- return list;
102
- };
@@ -1,29 +0,0 @@
1
- "use strict";
2
-
3
- module.exports = function (url, options) {
4
- if (!options) {
5
- options = {};
6
- }
7
-
8
- if (!url) {
9
- return url;
10
- }
11
-
12
- url = String(url.__esModule ? url.default : url); // If url is already wrapped in quotes, remove them
13
-
14
- if (/^['"].*['"]$/.test(url)) {
15
- url = url.slice(1, -1);
16
- }
17
-
18
- if (options.hash) {
19
- url += options.hash;
20
- } // Should url be wrapped?
21
- // See https://drafts.csswg.org/css-values-3/#urls
22
-
23
-
24
- if (/["'() \t\n]|(%20)/.test(url) || options.needQuotes) {
25
- return "\"".concat(url.replace(/"/g, '\\"').replace(/\n/g, "\\n"), "\"");
26
- }
27
-
28
- return url;
29
- };