@umijs/bundler-webpack 4.0.0-rc.10 → 4.0.0-rc.13
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 +10 -4
- package/client/constants.js +6 -0
- 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 +4473 -2910
- package/compiled/webpack/types.d.ts +606 -171
- package/compiled/webpack-manifest-plugin/index.js +1 -1
- package/dist/build.d.ts +1 -0
- package/dist/build.js +1 -0
- package/dist/client/client.js +10 -4
- package/dist/config/compressPlugin.js +9 -1
- package/dist/config/config.d.ts +1 -0
- package/dist/config/config.js +7 -2
- package/dist/config/nodePolyfill.js +1 -1
- package/dist/config/nodePrefixPlugin.d.ts +11 -0
- package/dist/config/nodePrefixPlugin.js +25 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +7 -1
- package/dist/dev.d.ts +4 -0
- package/dist/dev.js +19 -7
- package/dist/schema.js +1 -0
- package/dist/server/https.d.ts +5 -0
- package/dist/server/https.js +73 -0
- package/dist/server/server.d.ts +3 -1
- package/dist/server/server.js +24 -3
- package/dist/utils/getEsBuildTarget.d.ts +5 -0
- package/dist/utils/getEsBuildTarget.js +12 -0
- package/package.json +14 -15
- package/compiled/tapable/index.js +0 -1
- package/compiled/tapable/package.json +0 -1
- package/compiled/tapable/tapable.d.ts +0 -116
- package/dist/utils/server.d.ts +0 -5
- package/dist/utils/server.js +0 -93
package/client/client/client.js
CHANGED
|
@@ -13,15 +13,21 @@ import * as ErrorOverlay from 'react-error-overlay';
|
|
|
13
13
|
import { MESSAGE_TYPE } from '../constants';
|
|
14
14
|
import { formatWebpackMessages } from '../utils/formatWebpackMessages';
|
|
15
15
|
console.log('[webpack] connecting...');
|
|
16
|
+
function getSocketHost() {
|
|
17
|
+
let l = location;
|
|
18
|
+
if (process.env.SOCKET_SERVER) {
|
|
19
|
+
l = new URL(process.env.SOCKET_SERVER);
|
|
20
|
+
}
|
|
21
|
+
const host = l.host;
|
|
22
|
+
const isHttps = l.protocol === 'https:';
|
|
23
|
+
return `${isHttps ? 'wss' : 'ws'}://${host}`;
|
|
24
|
+
}
|
|
16
25
|
let pingTimer = null;
|
|
17
|
-
const host = location.host;
|
|
18
|
-
const isHttps = location.protocol === 'https:';
|
|
19
|
-
const wsUrl = `${isHttps ? 'wss' : 'ws'}://${host}`;
|
|
20
26
|
let isFirstCompilation = true;
|
|
21
27
|
let mostRecentCompilationHash = null;
|
|
22
28
|
let hasCompileErrors = false;
|
|
23
29
|
let hadRuntimeError = false;
|
|
24
|
-
const socket = new WebSocket(
|
|
30
|
+
const socket = new WebSocket(getSocketHost(), 'webpack-hmr');
|
|
25
31
|
socket.addEventListener('message', ({ data }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
32
|
data = JSON.parse(data);
|
|
27
33
|
if (data.type === 'connected') {
|