@umijs/bundler-webpack 4.0.52 → 4.0.53
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/dist/build.js +36 -0
- package/dist/server/ws.d.ts +1 -1
- package/package.json +5 -5
package/dist/build.js
CHANGED
|
@@ -91,6 +91,7 @@ async function build(opts) {
|
|
|
91
91
|
}
|
|
92
92
|
if (stats) {
|
|
93
93
|
const errorMsg = stats.toString("errors-only");
|
|
94
|
+
esbuildCompressErrorHelper(errorMsg);
|
|
94
95
|
reject(new Error(errorMsg));
|
|
95
96
|
}
|
|
96
97
|
} else {
|
|
@@ -111,6 +112,41 @@ async function build(opts) {
|
|
|
111
112
|
}
|
|
112
113
|
});
|
|
113
114
|
}
|
|
115
|
+
function esbuildCompressErrorHelper(errorMsg) {
|
|
116
|
+
if (typeof errorMsg !== "string")
|
|
117
|
+
return;
|
|
118
|
+
if (
|
|
119
|
+
// https://github.com/evanw/esbuild/blob/a5f781ecd5edeb3fb6ae8d1045507ab850462614/internal/js_parser/js_parser_lower.go#L18
|
|
120
|
+
errorMsg.includes("configured target environment") && errorMsg.includes("es2015")
|
|
121
|
+
) {
|
|
122
|
+
const terserRecommend = {
|
|
123
|
+
label: import_utils.chalk.green("change jsMinifier"),
|
|
124
|
+
details: import_utils.chalk.cyan(` jsMinifier: 'terser'`)
|
|
125
|
+
};
|
|
126
|
+
const upgradeTargetRecommend = {
|
|
127
|
+
label: import_utils.chalk.green("upgrade target"),
|
|
128
|
+
details: import_utils.chalk.cyan(` jsMinifierOptions: {
|
|
129
|
+
target: ['chrome80', 'es2020']
|
|
130
|
+
}`)
|
|
131
|
+
};
|
|
132
|
+
const ieRecommend = {
|
|
133
|
+
details: `P.S. compatible with legacy browsers: https://umijs.org/blog/legacy-browser`
|
|
134
|
+
};
|
|
135
|
+
console.log();
|
|
136
|
+
console.log(import_utils.chalk.bgRed(" COMPRESSION ERROR "));
|
|
137
|
+
console.log(
|
|
138
|
+
import_utils.chalk.yellow(
|
|
139
|
+
`esbuild minify failed, please ${terserRecommend.label} or ${upgradeTargetRecommend.label}:`
|
|
140
|
+
)
|
|
141
|
+
);
|
|
142
|
+
console.log("e.g. ");
|
|
143
|
+
console.log(terserRecommend.details);
|
|
144
|
+
console.log(" or");
|
|
145
|
+
console.log(upgradeTargetRecommend.details);
|
|
146
|
+
console.log(ieRecommend.details);
|
|
147
|
+
console.log();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
114
150
|
// Annotate the CommonJS export names for ESM import in node:
|
|
115
151
|
0 && (module.exports = {
|
|
116
152
|
build
|
package/dist/server/ws.d.ts
CHANGED
|
@@ -8,6 +8,6 @@ import { Server as HttpsServer } from 'https';
|
|
|
8
8
|
import WebSocket from '../../compiled/ws';
|
|
9
9
|
export declare function createWebSocketServer(server: HttpServer | HttpsServer | Http2Server | Server): {
|
|
10
10
|
send(message: string): void;
|
|
11
|
-
wss: WebSocket.Server
|
|
11
|
+
wss: WebSocket.Server<WebSocket.WebSocket>;
|
|
12
12
|
close(): void;
|
|
13
13
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/bundler-webpack",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.53",
|
|
4
4
|
"description": "@umijs/bundler-webpack",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi/tree/master/packages/bundler-webpack#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi/issues",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"@svgr/plugin-jsx": "^6.2.1",
|
|
34
34
|
"@svgr/plugin-svgo": "^6.2.0",
|
|
35
35
|
"@types/hapi__joi": "17.1.9",
|
|
36
|
-
"@umijs/babel-preset-umi": "4.0.
|
|
37
|
-
"@umijs/bundler-utils": "4.0.
|
|
36
|
+
"@umijs/babel-preset-umi": "4.0.53",
|
|
37
|
+
"@umijs/bundler-utils": "4.0.53",
|
|
38
38
|
"@umijs/case-sensitive-paths-webpack-plugin": "^1.0.1",
|
|
39
|
-
"@umijs/mfsu": "4.0.
|
|
40
|
-
"@umijs/utils": "4.0.
|
|
39
|
+
"@umijs/mfsu": "4.0.53",
|
|
40
|
+
"@umijs/utils": "4.0.53",
|
|
41
41
|
"cors": "^2.8.5",
|
|
42
42
|
"css-loader": "6.7.1",
|
|
43
43
|
"es5-imcompatible-versions": "^0.1.73",
|