@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.
Files changed (44) hide show
  1. package/client/client/client.js +10 -4
  2. package/client/constants.js +6 -0
  3. package/compiled/cssnano/index.js +6 -6
  4. package/compiled/fork-ts-checker-webpack-plugin/index.js +7 -13
  5. package/compiled/{tapable → react-refresh}/LICENSE +6 -6
  6. package/compiled/react-refresh/index.js +9 -7
  7. package/compiled/react-refresh/package.json +1 -0
  8. package/compiled/webpack/BasicEffectRulePlugin.js +1 -0
  9. package/compiled/webpack/BasicMatcherRulePlugin.js +1 -0
  10. package/compiled/webpack/HotModuleReplacement.runtime.js +29 -14
  11. package/compiled/webpack/JavascriptHotModuleReplacement.runtime.js +4 -3
  12. package/compiled/webpack/ObjectMatcherRulePlugin.js +1 -0
  13. package/compiled/webpack/RuleSetCompiler.js +1 -0
  14. package/compiled/webpack/UseEffectRulePlugin.js +1 -0
  15. package/compiled/webpack/deepImports.json +6 -1
  16. package/compiled/webpack/index.js +4473 -2910
  17. package/compiled/webpack/types.d.ts +606 -171
  18. package/compiled/webpack-manifest-plugin/index.js +1 -1
  19. package/dist/build.d.ts +1 -0
  20. package/dist/build.js +1 -0
  21. package/dist/client/client.js +10 -4
  22. package/dist/config/compressPlugin.js +9 -1
  23. package/dist/config/config.d.ts +1 -0
  24. package/dist/config/config.js +7 -2
  25. package/dist/config/nodePolyfill.js +1 -1
  26. package/dist/config/nodePrefixPlugin.d.ts +11 -0
  27. package/dist/config/nodePrefixPlugin.js +25 -0
  28. package/dist/constants.d.ts +1 -0
  29. package/dist/constants.js +7 -1
  30. package/dist/dev.d.ts +4 -0
  31. package/dist/dev.js +19 -7
  32. package/dist/schema.js +1 -0
  33. package/dist/server/https.d.ts +5 -0
  34. package/dist/server/https.js +73 -0
  35. package/dist/server/server.d.ts +3 -1
  36. package/dist/server/server.js +24 -3
  37. package/dist/utils/getEsBuildTarget.d.ts +5 -0
  38. package/dist/utils/getEsBuildTarget.js +12 -0
  39. package/package.json +14 -15
  40. package/compiled/tapable/index.js +0 -1
  41. package/compiled/tapable/package.json +0 -1
  42. package/compiled/tapable/tapable.d.ts +0 -116
  43. package/dist/utils/server.d.ts +0 -5
  44. package/dist/utils/server.js +0 -93
@@ -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(wsUrl, 'webpack-hmr');
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') {
@@ -13,3 +13,9 @@ export var MESSAGE_TYPE;
13
13
  export const DEFAULT_BROWSER_TARGETS = {
14
14
  chrome: 80,
15
15
  };
16
+ export const DEFAULT_ESBUILD_TARGET_KEYS = [
17
+ 'chrome',
18
+ 'firefox',
19
+ 'edge',
20
+ 'safari',
21
+ ];