@umijs/bundler-webpack 4.0.42 → 4.0.44
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/utils/formatWebpackMessages.js +27 -8
- package/compiled/babel-loader/index.js +8 -2
- package/compiled/babel-loader/package.json +1 -1
- package/compiled/less-loader/index.js +1 -1
- package/compiled/less-loader/package.json +1 -1
- package/compiled/mini-css-extract-plugin/hmr/hotModuleReplacement.js +22 -60
- package/compiled/mini-css-extract-plugin/hmr/normalize-url.js +2 -10
- package/compiled/mini-css-extract-plugin/index.js +492 -696
- package/compiled/mini-css-extract-plugin/loader.js +54 -120
- package/compiled/mini-css-extract-plugin/package.json +1 -1
- package/compiled/mini-css-extract-plugin/utils.js +27 -44
- package/compiled/postcss-loader/index.js +1 -1
- package/compiled/postcss-loader/package.json +1 -1
- package/compiled/sass-loader/index.js +1 -1
- package/compiled/sass-loader/package.json +1 -1
- package/compiled/sass-loader/sass.default.dart.js +4 -0
- package/compiled/terser/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts +90 -0
- package/compiled/terser/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts +12 -0
- package/compiled/terser/@jridgewell/gen-mapping/dist/types/types.d.ts +35 -0
- package/compiled/terser/@jridgewell/source-map/dist/types/source-map.d.ts +25 -0
- package/compiled/terser/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts +16 -0
- package/compiled/terser/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts +74 -0
- package/compiled/terser/@jridgewell/trace-mapping/dist/types/types.d.ts +92 -0
- package/compiled/terser/index.js +1 -1
- package/compiled/terser/package.json +1 -1
- package/compiled/terser/tools/terser.d.ts +6 -3
- package/compiled/terser-webpack-plugin/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts +16 -0
- package/compiled/terser-webpack-plugin/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts +74 -0
- package/compiled/terser-webpack-plugin/@jridgewell/trace-mapping/dist/types/types.d.ts +92 -0
- package/compiled/terser-webpack-plugin/index.js +1211 -3390
- package/compiled/terser-webpack-plugin/package.json +1 -1
- package/compiled/terser-webpack-plugin/types/index.d.ts +10 -10
- package/compiled/terser-webpack-plugin/types/utils.d.ts +10 -9
- package/compiled/terser-webpack-plugin/utils.js +36 -10
- package/compiled/webpack/package.json +1 -1
- package/compiled/webpack/types.d.ts +137 -126
- package/compiled/webpack-5-chain/index.js +1 -1
- package/compiled/webpack-5-chain/package.json +1 -1
- package/compiled/webpack-5-chain/types/index.d.ts +76 -20
- package/compiled/webpack-bundle-analyzer/index.js +7 -6
- package/compiled/webpack-bundle-analyzer/package.json +1 -1
- package/compiled/webpack-bundle-analyzer/public/viewer.js +2 -2
- package/compiled/webpack-bundle-analyzer/public/viewer.js.map +1 -1
- package/compiled/webpack-dev-middleware/index.js +5 -5
- package/compiled/webpack-dev-middleware/package.json +1 -1
- package/compiled/ws/LICENSE +13 -12
- package/compiled/ws/index.d.ts +73 -33
- package/compiled/ws/index.js +1 -1
- package/compiled/ws/package.json +1 -1
- package/dist/build.js +8 -2
- package/dist/cli.js +4 -1
- package/dist/config/compressPlugin.js +4 -1
- package/dist/config/config.js +41 -11
- package/dist/config/cssRules.js +17 -5
- package/dist/config/detectDeadCode.js +38 -8
- package/dist/config/detectDeadCodePlugin.js +8 -2
- package/dist/config/fastRefreshPlugin.js +4 -1
- package/dist/config/forkTSCheckerPlugin.js +4 -1
- package/dist/config/harmonyLinkingErrorPlugin.js +14 -11
- package/dist/config/javaScriptRules.js +10 -5
- package/dist/config/miniCSSExtractPlugin.js +4 -1
- package/dist/config/progressPlugin.js +9 -2
- package/dist/config/speedMeasureWebpackPlugin.js +7 -2
- package/dist/config/ssrPlugin.js +20 -6
- package/dist/config/svgRules.js +4 -1
- package/dist/dev.js +29 -10
- package/dist/loader/svgr.js +16 -11
- package/dist/loader/swc.js +26 -8
- package/dist/parcelCSS.js +4 -1
- package/dist/plugins/ProgressPlugin.js +6 -2
- package/dist/plugins/RuntimePublicPathPlugin.js +9 -6
- package/dist/plugins/_SamplePlugin.d.ts +1 -1
- package/dist/plugins/_SamplePlugin.js +1 -1
- package/dist/requireHook.js +4 -1
- package/dist/schema.js +58 -23
- package/dist/server/server.d.ts +1 -4
- package/dist/server/server.js +37 -23
- package/dist/server/ws.js +8 -3
- package/dist/swcPlugins/autoCSSModules.js +4 -1
- package/dist/swcPlugins/lockCoreJS.js +8 -2
- package/dist/types.d.ts +2 -1
- package/dist/utils/formatWebpackMessages.js +31 -9
- package/dist/utils/getEsBuildTarget.js +7 -1
- package/package.json +25 -24
|
@@ -19,7 +19,9 @@ function formatMessage(message) {
|
|
|
19
19
|
}
|
|
20
20
|
lines = lines.filter((line) => !/Module [A-z ]+\(from/.test(line));
|
|
21
21
|
lines = lines.map((line) => {
|
|
22
|
-
const parsingError = /Line (\d+):(?:(\d+):)?\s*Parsing error: (.+)$/.exec(
|
|
22
|
+
const parsingError = /Line (\d+):(?:(\d+):)?\s*Parsing error: (.+)$/.exec(
|
|
23
|
+
line
|
|
24
|
+
);
|
|
23
25
|
if (!parsingError) {
|
|
24
26
|
return line;
|
|
25
27
|
}
|
|
@@ -27,11 +29,23 @@ function formatMessage(message) {
|
|
|
27
29
|
return `${friendlySyntaxErrorLabel} ${errorMessage} (${errorLine}:${errorColumn})`;
|
|
28
30
|
});
|
|
29
31
|
message = lines.join("\n");
|
|
30
|
-
message = message.replace(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
message = message.replace(
|
|
33
|
+
/SyntaxError\s+\((\d+):(\d+)\)\s*(.+?)\n/g,
|
|
34
|
+
`${friendlySyntaxErrorLabel} $3 ($1:$2)
|
|
35
|
+
`
|
|
36
|
+
);
|
|
37
|
+
message = message.replace(
|
|
38
|
+
/^.*export '(.+?)' was not found in '(.+?)'.*$/gm,
|
|
39
|
+
`Attempted import error: '$1' is not exported from '$2'.`
|
|
40
|
+
);
|
|
41
|
+
message = message.replace(
|
|
42
|
+
/^.*export 'default' \(imported as '(.+?)'\) was not found in '(.+?)'.*$/gm,
|
|
43
|
+
`Attempted import error: '$2' does not contain a default export (imported as '$1').`
|
|
44
|
+
);
|
|
45
|
+
message = message.replace(
|
|
46
|
+
/^.*export '(.+?)' \(imported as '(.+?)'\) was not found in '(.+?)'.*$/gm,
|
|
47
|
+
`Attempted import error: '$1' is not exported from '$3' (imported as '$2').`
|
|
48
|
+
);
|
|
35
49
|
lines = message.split("\n");
|
|
36
50
|
if (lines.length > 2 && lines[1].trim() === "") {
|
|
37
51
|
lines.splice(1, 1);
|
|
@@ -48,10 +62,15 @@ function formatMessage(message) {
|
|
|
48
62
|
lines[1] += "Run `npm install sass` or `yarn add sass` inside your workspace.";
|
|
49
63
|
}
|
|
50
64
|
message = lines.join("\n");
|
|
51
|
-
message = message.replace(
|
|
65
|
+
message = message.replace(
|
|
66
|
+
/^\s*at\s((?!webpack:).)*:\d+:\d+[\s)]*(\n|$)/gm,
|
|
67
|
+
""
|
|
68
|
+
);
|
|
52
69
|
message = message.replace(/^\s*at\s<anonymous>(\n|$)/gm, "");
|
|
53
70
|
lines = message.split("\n");
|
|
54
|
-
lines = lines.filter(
|
|
71
|
+
lines = lines.filter(
|
|
72
|
+
(line, index, arr) => index === 0 || line.trim() !== "" || line.trim() !== arr[index - 1].trim()
|
|
73
|
+
);
|
|
55
74
|
message = lines.join("\n");
|
|
56
75
|
return message.trim();
|
|
57
76
|
}
|