@umijs/bundler-webpack 4.0.8 → 4.0.11

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 (56) hide show
  1. package/client/client/client.js +311 -190
  2. package/client/constants.js +1 -1
  3. package/client/utils/formatWebpackMessages.js +1 -1
  4. package/dist/build.js +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/config/_sampleFeature.js +1 -1
  7. package/dist/config/assetRules.js +1 -1
  8. package/dist/config/bundleAnalyzerPlugin.js +1 -1
  9. package/dist/config/compressPlugin.js +3 -2
  10. package/dist/config/config.js +1 -1
  11. package/dist/config/copyPlugin.js +4 -3
  12. package/dist/config/cssRules.js +1 -1
  13. package/dist/config/definePlugin.js +1 -1
  14. package/dist/config/detectDeadCode.js +1 -1
  15. package/dist/config/detectDeadCodePlugin.js +1 -1
  16. package/dist/config/fastRefreshPlugin.js +1 -1
  17. package/dist/config/forkTSCheckerPlugin.js +1 -1
  18. package/dist/config/harmonyLinkingErrorPlugin.js +1 -1
  19. package/dist/config/ignorePlugin.js +1 -1
  20. package/dist/config/javaScriptRules.js +2 -1
  21. package/dist/config/manifestPlugin.js +1 -1
  22. package/dist/config/miniCSSExtractPlugin.js +1 -1
  23. package/dist/config/nodePolyfill.js +1 -1
  24. package/dist/config/nodePrefixPlugin.js +1 -1
  25. package/dist/config/progressPlugin.js +1 -1
  26. package/dist/config/purgecssWebpackPlugin.js +1 -1
  27. package/dist/config/speedMeasureWebpackPlugin.js +1 -1
  28. package/dist/config/ssrPlugin.js +1 -1
  29. package/dist/config/svgRules.js +1 -1
  30. package/dist/constants.js +1 -1
  31. package/dist/dev.js +15 -7
  32. package/dist/index.js +1 -1
  33. package/dist/loader/svgr.js +1 -1
  34. package/dist/loader/swc.js +1 -1
  35. package/dist/parcelCSS.js +1 -1
  36. package/dist/plugins/ProgressPlugin.js +1 -1
  37. package/dist/plugins/RuntimePublicPathPlugin.js +1 -1
  38. package/dist/plugins/_SamplePlugin.js +1 -1
  39. package/dist/requireHook.js +1 -1
  40. package/dist/schema.js +5 -1
  41. package/dist/server/server.js +8 -1
  42. package/dist/server/ws.js +1 -1
  43. package/dist/swcPlugins/autoCSSModules.js +1 -1
  44. package/dist/swcPlugins/changeImportFromString.js +1 -1
  45. package/dist/swcPlugins/lockCoreJS.js +1 -1
  46. package/dist/types.d.ts +2 -1
  47. package/dist/types.js +1 -1
  48. package/dist/utils/browsersList.js +1 -1
  49. package/dist/utils/depMatch.js +1 -1
  50. package/dist/utils/formatWebpackMessages.js +1 -1
  51. package/dist/utils/getEsBuildTarget.d.ts +3 -1
  52. package/dist/utils/getEsBuildTarget.js +8 -2
  53. package/package.json +10 -12
  54. package/compiled/react-refresh/LICENSE +0 -21
  55. package/compiled/react-refresh/index.js +0 -21
  56. package/compiled/react-refresh/package.json +0 -1
@@ -19,7 +19,7 @@ var __copyProps = (to, from, except, desc) => {
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
21
 
22
- // detectDeadCode.ts
22
+ // src/config/detectDeadCode.ts
23
23
  var detectDeadCode_exports = {};
24
24
  __export(detectDeadCode_exports, {
25
25
  default: () => detectDeadCode_default,
@@ -36,7 +36,7 @@ var __copyProps = (to, from, except, desc) => {
36
36
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
37
37
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
38
38
 
39
- // detectDeadCodePlugin.ts
39
+ // src/config/detectDeadCodePlugin.ts
40
40
  var detectDeadCodePlugin_exports = {};
41
41
  __export(detectDeadCodePlugin_exports, {
42
42
  addDetectDeadCodePlugin: () => addDetectDeadCodePlugin
@@ -19,7 +19,7 @@ var __copyProps = (to, from, except, desc) => {
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
21
 
22
- // fastRefreshPlugin.ts
22
+ // src/config/fastRefreshPlugin.ts
23
23
  var fastRefreshPlugin_exports = {};
24
24
  __export(fastRefreshPlugin_exports, {
25
25
  addFastRefreshPlugin: () => addFastRefreshPlugin
@@ -19,7 +19,7 @@ var __copyProps = (to, from, except, desc) => {
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
21
 
22
- // forkTSCheckerPlugin.ts
22
+ // src/config/forkTSCheckerPlugin.ts
23
23
  var forkTSCheckerPlugin_exports = {};
24
24
  __export(forkTSCheckerPlugin_exports, {
25
25
  addForkTSCheckerPlugin: () => addForkTSCheckerPlugin
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // harmonyLinkingErrorPlugin.ts
19
+ // src/config/harmonyLinkingErrorPlugin.ts
20
20
  var harmonyLinkingErrorPlugin_exports = {};
21
21
  __export(harmonyLinkingErrorPlugin_exports, {
22
22
  addHarmonyLinkingErrorPlugin: () => addHarmonyLinkingErrorPlugin
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // ignorePlugin.ts
19
+ // src/config/ignorePlugin.ts
20
20
  var ignorePlugin_exports = {};
21
21
  __export(ignorePlugin_exports, {
22
22
  addIgnorePlugin: () => addIgnorePlugin
@@ -19,7 +19,7 @@ var __copyProps = (to, from, except, desc) => {
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
21
 
22
- // javaScriptRules.ts
22
+ // src/config/javaScriptRules.ts
23
23
  var javaScriptRules_exports = {};
24
24
  __export(javaScriptRules_exports, {
25
25
  addJavaScriptRules: () => addJavaScriptRules
@@ -95,6 +95,7 @@ async function addJavaScriptRules(opts) {
95
95
  babelrc: false,
96
96
  cacheDirectory: false,
97
97
  targets: userConfig.targets,
98
+ customize: userConfig.babelLoaderCustomize,
98
99
  presets: [
99
100
  opts.babelPreset || [
100
101
  require.resolve("@umijs/babel-preset-umi"),
@@ -30,7 +30,7 @@ var __copyProps = (to, from, except, desc) => {
30
30
  };
31
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
32
 
33
- // manifestPlugin.ts
33
+ // src/config/manifestPlugin.ts
34
34
  var manifestPlugin_exports = {};
35
35
  __export(manifestPlugin_exports, {
36
36
  addManifestPlugin: () => addManifestPlugin
@@ -19,7 +19,7 @@ var __copyProps = (to, from, except, desc) => {
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
21
 
22
- // miniCSSExtractPlugin.ts
22
+ // src/config/miniCSSExtractPlugin.ts
23
23
  var miniCSSExtractPlugin_exports = {};
24
24
  __export(miniCSSExtractPlugin_exports, {
25
25
  addMiniCSSExtractPlugin: () => addMiniCSSExtractPlugin
@@ -33,7 +33,7 @@ var __copyProps = (to, from, except, desc) => {
33
33
  };
34
34
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
35
 
36
- // nodePolyfill.ts
36
+ // src/config/nodePolyfill.ts
37
37
  var nodePolyfill_exports = {};
38
38
  __export(nodePolyfill_exports, {
39
39
  addNodePolyfill: () => addNodePolyfill
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // nodePrefixPlugin.ts
19
+ // src/config/nodePrefixPlugin.ts
20
20
  var nodePrefixPlugin_exports = {};
21
21
  __export(nodePrefixPlugin_exports, {
22
22
  addNodePrefixPlugin: () => addNodePrefixPlugin
@@ -19,7 +19,7 @@ var __copyProps = (to, from, except, desc) => {
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
21
 
22
- // progressPlugin.ts
22
+ // src/config/progressPlugin.ts
23
23
  var progressPlugin_exports = {};
24
24
  __export(progressPlugin_exports, {
25
25
  addProgressPlugin: () => addProgressPlugin
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // purgecssWebpackPlugin.ts
19
+ // src/config/purgecssWebpackPlugin.ts
20
20
  var purgecssWebpackPlugin_exports = {};
21
21
  __export(purgecssWebpackPlugin_exports, {
22
22
  applyPurgeCSSWebpackPlugin: () => applyPurgeCSSWebpackPlugin
@@ -19,7 +19,7 @@ var __copyProps = (to, from, except, desc) => {
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
21
 
22
- // speedMeasureWebpackPlugin.ts
22
+ // src/config/speedMeasureWebpackPlugin.ts
23
23
  var speedMeasureWebpackPlugin_exports = {};
24
24
  __export(speedMeasureWebpackPlugin_exports, {
25
25
  addSpeedMeasureWebpackPlugin: () => addSpeedMeasureWebpackPlugin
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // ssrPlugin.ts
19
+ // src/config/ssrPlugin.ts
20
20
  var ssrPlugin_exports = {};
21
21
  __export(ssrPlugin_exports, {
22
22
  default: () => addSSRPlugin
@@ -36,7 +36,7 @@ var __copyProps = (to, from, except, desc) => {
36
36
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
37
37
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
38
38
 
39
- // svgRules.ts
39
+ // src/config/svgRules.ts
40
40
  var svgRules_exports = {};
41
41
  __export(svgRules_exports, {
42
42
  addSVGRules: () => addSVGRules
package/dist/constants.js CHANGED
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // constants.ts
19
+ // src/constants.ts
20
20
  var constants_exports = {};
21
21
  __export(constants_exports, {
22
22
  DEFAULT_BROWSER_TARGETS: () => DEFAULT_BROWSER_TARGETS,
package/dist/dev.js CHANGED
@@ -36,7 +36,7 @@ var __copyProps = (to, from, except, desc) => {
36
36
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
37
37
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
38
38
 
39
- // dev.ts
39
+ // src/dev.ts
40
40
  var dev_exports = {};
41
41
  __export(dev_exports, {
42
42
  dev: () => dev,
@@ -61,10 +61,14 @@ function stripUndefined(obj) {
61
61
  return obj;
62
62
  }
63
63
  async function dev(opts) {
64
- var _a, _b, _c, _d, _e, _f, _g, _h;
64
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
65
65
  const cacheDirectoryPath = (0, import_path.resolve)(opts.rootDir || opts.cwd, opts.config.cacheDirectoryPath || "node_modules/.cache");
66
66
  const enableMFSU = opts.config.mfsu !== false;
67
67
  let mfsu = null;
68
+ let devHost = "localhost";
69
+ if (opts.host && opts.host !== "0.0.0.0") {
70
+ devHost = opts.host;
71
+ }
68
72
  if (enableMFSU) {
69
73
  if (opts.config.srcTranspiler === import_types.Transpiler.swc) {
70
74
  import_utils.logger.warn(`Swc currently not supported for use with mfsu, recommended you use srcTranspiler: 'esbuild' in dev.`);
@@ -83,6 +87,9 @@ async function dev(opts) {
83
87
  tmpBase: ((_d = opts.config.mfsu) == null ? void 0 : _d.cacheDirectory) || (0, import_path.join)(cacheDirectoryPath, "mfsu"),
84
88
  onMFSUProgress: opts.onMFSUProgress,
85
89
  unMatchLibs: (_e = opts.config.mfsu) == null ? void 0 : _e.exclude,
90
+ shared: (_f = opts.config.mfsu) == null ? void 0 : _f.shared,
91
+ remoteAliases: (_g = opts.config.mfsu) == null ? void 0 : _g.remoteAliases,
92
+ remoteName: (_h = opts.config.mfsu) == null ? void 0 : _h.remoteName,
86
93
  getCacheDependency() {
87
94
  return stripUndefined({
88
95
  version: require("../package.json").version,
@@ -93,7 +100,8 @@ async function dev(opts) {
93
100
  runtimePublicPath: opts.config.runtimePublicPath,
94
101
  publicPath: opts.config.publicPath
95
102
  });
96
- }
103
+ },
104
+ serverBase: `${opts.config.https ? "https" : "http"}://${devHost}:${opts.port || 8e3}`
97
105
  });
98
106
  }
99
107
  const webpackConfig = await (0, import_config.getConfig)({
@@ -132,14 +140,14 @@ async function dev(opts) {
132
140
  hash: true,
133
141
  staticPathPrefix: import_mfsu.MF_DEP_PREFIX,
134
142
  name: import_constants.MFSU_NAME,
135
- chainWebpack: (_f = opts.config.mfsu) == null ? void 0 : _f.chainWebpack,
143
+ chainWebpack: (_i = opts.config.mfsu) == null ? void 0 : _i.chainWebpack,
136
144
  cache: {
137
- buildDependencies: (_g = opts.cache) == null ? void 0 : _g.buildDependencies,
145
+ buildDependencies: (_j = opts.cache) == null ? void 0 : _j.buildDependencies,
138
146
  cacheDirectory: (0, import_path.join)(cacheDirectoryPath, "mfsu-deps")
139
147
  },
140
148
  pkg: opts.pkg
141
149
  });
142
- (_h = webpackConfig.resolve).alias || (_h.alias = {});
150
+ (_k = webpackConfig.resolve).alias || (_k.alias = {});
143
151
  ["@umijs/utils/compiled/strip-ansi", "react-error-overlay"].forEach((dep) => {
144
152
  webpackConfig.resolve.alias[dep] = require.resolve(dep);
145
153
  });
@@ -165,7 +173,7 @@ async function dev(opts) {
165
173
  ...opts.beforeMiddlewares || []
166
174
  ],
167
175
  port: opts.port,
168
- host: opts.host,
176
+ host: devHost,
169
177
  afterMiddlewares: [...opts.afterMiddlewares || []],
170
178
  onDevCompileDone: opts.onDevCompileDone,
171
179
  onProgress: opts.onProgress
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ var __copyProps = (to, from, except, desc) => {
13
13
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
15
 
16
- // index.ts
16
+ // src/index.ts
17
17
  var src_exports = {};
18
18
  module.exports = __toCommonJS(src_exports);
19
19
  var import_requireHook = require("./requireHook");
@@ -19,7 +19,7 @@ var __copyProps = (to, from, except, desc) => {
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
21
 
22
- // svgr.ts
22
+ // src/loader/svgr.ts
23
23
  var svgr_exports = {};
24
24
  __export(svgr_exports, {
25
25
  default: () => svgr_default
@@ -45,7 +45,7 @@ var __copyProps = (to, from, except, desc) => {
45
45
  };
46
46
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
47
47
 
48
- // swc.ts
48
+ // src/loader/swc.ts
49
49
  var swc_exports = {};
50
50
  __export(swc_exports, {
51
51
  default: () => swc_default
package/dist/parcelCSS.js CHANGED
@@ -19,7 +19,7 @@ var __copyProps = (to, from, except, desc) => {
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
21
 
22
- // parcelCSS.ts
22
+ // src/parcelCSS.ts
23
23
  var parcelCSS_exports = {};
24
24
  __export(parcelCSS_exports, {
25
25
  parcelCSS: () => parcelCSS
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // ProgressPlugin.ts
19
+ // src/plugins/ProgressPlugin.ts
20
20
  var ProgressPlugin_exports = {};
21
21
  __export(ProgressPlugin_exports, {
22
22
  default: () => ProgressPlugin_default
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // RuntimePublicPathPlugin.ts
19
+ // src/plugins/RuntimePublicPathPlugin.ts
20
20
  var RuntimePublicPathPlugin_exports = {};
21
21
  __export(RuntimePublicPathPlugin_exports, {
22
22
  RuntimePublicPathPlugin: () => RuntimePublicPathPlugin
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // _SamplePlugin.ts
19
+ // src/plugins/_SamplePlugin.ts
20
20
  var SamplePlugin_exports = {};
21
21
  __export(SamplePlugin_exports, {
22
22
  default: () => SamplePlugin_default
@@ -14,7 +14,7 @@ var __copyProps = (to, from, except, desc) => {
14
14
  };
15
15
  var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps(isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target, mod2));
16
16
 
17
- // requireHook.ts
17
+ // src/requireHook.ts
18
18
  var import_deepImports = __toESM(require("@umijs/bundler-webpack/compiled/webpack/deepImports.json"));
19
19
  var import_path = require("path");
20
20
  var PKG_ROOT = (0, import_path.join)(__dirname, "../");
package/dist/schema.js CHANGED
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // schema.ts
19
+ // src/schema.ts
20
20
  var schema_exports = {};
21
21
  __export(schema_exports, {
22
22
  getSchemas: () => getSchemas
@@ -56,6 +56,7 @@ function getSchemas() {
56
56
  alias: (Joi) => Joi.object(),
57
57
  autoCSSModules: (Joi) => Joi.boolean(),
58
58
  autoprefixer: (Joi) => Joi.object(),
59
+ babelLoaderCustomize: (Joi) => Joi.string(),
59
60
  cacheDirectoryPath: (Joi) => Joi.string(),
60
61
  chainWebpack: (Joi) => Joi.function(),
61
62
  copy: (Joi) => Joi.array().items(Joi.alternatives().try(Joi.object({
@@ -97,7 +98,10 @@ function getSchemas() {
97
98
  exclude: Joi.array().items(Joi.alternatives().try(Joi.string(), Joi.object().regex())),
98
99
  include: Joi.array().items(Joi.string()),
99
100
  mfName: Joi.string(),
101
+ remoteAliases: Joi.array().items(Joi.string()),
102
+ remoteName: Joi.string(),
100
103
  runtimePublicPath: Joi.boolean(),
104
+ shared: Joi.object(),
101
105
  strategy: Joi.string().valid("eager", "normal").default("normal")
102
106
  }), Joi.boolean()),
103
107
  outputPath: (Joi) => Joi.string(),
@@ -36,7 +36,7 @@ var __copyProps = (to, from, except, desc) => {
36
36
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
37
37
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
38
38
 
39
- // server.ts
39
+ // src/server/server.ts
40
40
  var server_exports = {};
41
41
  __export(server_exports, {
42
42
  createServer: () => createServer
@@ -162,6 +162,13 @@ async function createServer(opts) {
162
162
  (0, import_assert.default)(typeof proxy2.target === "string", "proxy.target must be string");
163
163
  (0, import_assert.default)(proxy2.context, "proxy.context must be supplied");
164
164
  middleware = (0, import_http_proxy_middleware.createProxyMiddleware)(proxy2.context, __spreadProps(__spreadValues({}, proxy2), {
165
+ onProxyReq(proxyReq, req, res) {
166
+ var _a, _b;
167
+ if (proxyReq.getHeader("origin")) {
168
+ proxyReq.setHeader("origin", ((_a = new URL(proxy2.target)) == null ? void 0 : _a.href) || "");
169
+ }
170
+ (_b = proxy2.onProxyReq) == null ? void 0 : _b.call(proxy2, proxyReq, req, res);
171
+ },
165
172
  onProxyRes(proxyRes, req, res) {
166
173
  var _a, _b;
167
174
  proxyRes.headers["x-real-url"] = ((_a = new URL(req.url || "", proxy2.target)) == null ? void 0 : _a.href) || "";
package/dist/server/ws.js CHANGED
@@ -19,7 +19,7 @@ var __copyProps = (to, from, except, desc) => {
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
21
 
22
- // ws.ts
22
+ // src/server/ws.ts
23
23
  var ws_exports = {};
24
24
  __export(ws_exports, {
25
25
  createWebSocketServer: () => createWebSocketServer
@@ -19,7 +19,7 @@ var __copyProps = (to, from, except, desc) => {
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
21
 
22
- // autoCSSModules.ts
22
+ // src/swcPlugins/autoCSSModules.ts
23
23
  var autoCSSModules_exports = {};
24
24
  __export(autoCSSModules_exports, {
25
25
  default: () => autoCSSModules_default
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // changeImportFromString.ts
19
+ // src/swcPlugins/changeImportFromString.ts
20
20
  var changeImportFromString_exports = {};
21
21
  __export(changeImportFromString_exports, {
22
22
  changeImportFromString: () => changeImportFromString
@@ -19,7 +19,7 @@ var __copyProps = (to, from, except, desc) => {
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
21
 
22
- // lockCoreJS.ts
22
+ // src/swcPlugins/lockCoreJS.ts
23
23
  var lockCoreJS_exports = {};
24
24
  __export(lockCoreJS_exports, {
25
25
  default: () => lockCoreJS_default
package/dist/types.d.ts CHANGED
@@ -75,7 +75,7 @@ export interface IConfig {
75
75
  extraPostCSSPlugins?: any[];
76
76
  hash?: boolean;
77
77
  ignoreMomentLocale?: boolean;
78
- jsMinifier?: JSMinifier;
78
+ jsMinifier?: `${JSMinifier}`;
79
79
  jsMinifierOptions?: {
80
80
  [key: string]: any;
81
81
  };
@@ -110,6 +110,7 @@ export interface IConfig {
110
110
  [key: string]: any;
111
111
  };
112
112
  writeToDisk?: boolean;
113
+ babelLoaderCustomize?: string;
113
114
  [key: string]: any;
114
115
  }
115
116
  export interface SwcOptions extends SwcConfig {
package/dist/types.js CHANGED
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // types.ts
19
+ // src/types.ts
20
20
  var types_exports = {};
21
21
  __export(types_exports, {
22
22
  CSSMinifier: () => CSSMinifier,
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // browsersList.ts
19
+ // src/utils/browsersList.ts
20
20
  var browsersList_exports = {};
21
21
  __export(browsersList_exports, {
22
22
  getBrowsersList: () => getBrowsersList
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // depMatch.ts
19
+ // src/utils/depMatch.ts
20
20
  var depMatch_exports = {};
21
21
  __export(depMatch_exports, {
22
22
  cleanCache: () => cleanCache,
@@ -19,7 +19,7 @@ var __copyProps = (to, from, except, desc) => {
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
21
 
22
- // formatWebpackMessages.ts
22
+ // src/utils/formatWebpackMessages.ts
23
23
  var formatWebpackMessages_exports = {};
24
24
  __export(formatWebpackMessages_exports, {
25
25
  formatMessage: () => formatMessage,
@@ -1,5 +1,7 @@
1
+ import { JSMinifier } from '../types';
1
2
  interface IOpts {
2
3
  targets: Record<string, any>;
4
+ jsMinifier: `${JSMinifier}`;
3
5
  }
4
- export declare function getEsBuildTarget({ targets }: IOpts): string[];
6
+ export declare function getEsBuildTarget({ targets, jsMinifier }: IOpts): string[];
5
7
  export {};
@@ -16,14 +16,20 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // getEsBuildTarget.ts
19
+ // src/utils/getEsBuildTarget.ts
20
20
  var getEsBuildTarget_exports = {};
21
21
  __export(getEsBuildTarget_exports, {
22
22
  getEsBuildTarget: () => getEsBuildTarget
23
23
  });
24
24
  module.exports = __toCommonJS(getEsBuildTarget_exports);
25
+ var import_utils = require("@umijs/utils");
25
26
  var import_constants = require("../constants");
26
- function getEsBuildTarget({ targets }) {
27
+ var import_types = require("../types");
28
+ function getEsBuildTarget({ targets, jsMinifier }) {
29
+ if (targets["ie"] && jsMinifier === import_types.JSMinifier.esbuild) {
30
+ import_utils.logger.error(`${import_utils.chalk.red(`jsMinifier: esbuild`)} is not supported when there is ie in the targets, you can use ${import_utils.chalk.green(`jsMinifier: 'terser'`)}`);
31
+ throw new Error("IE is not supported");
32
+ }
27
33
  return Object.keys(targets).filter((key) => import_constants.DEFAULT_ESBUILD_TARGET_KEYS.includes(key)).map((key) => {
28
34
  return `${key}${targets[key] === true ? "0" : targets[key]}`;
29
35
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/bundler-webpack",
3
- "version": "4.0.8",
3
+ "version": "4.0.11",
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",
@@ -21,9 +21,9 @@
21
21
  "dist"
22
22
  ],
23
23
  "scripts": {
24
- "build": "pnpm father build",
24
+ "build": "umi-scripts father build",
25
25
  "build:deps": "umi-scripts bundleDeps",
26
- "dev": "pnpm father dev",
26
+ "dev": "umi-scripts father dev",
27
27
  "generate:webpackPackages": "zx ./scripts/generateWebpackPackages.mjs",
28
28
  "test": "umi-scripts jest-turbo"
29
29
  },
@@ -34,11 +34,11 @@
34
34
  "@svgr/plugin-jsx": "^6.2.1",
35
35
  "@svgr/plugin-svgo": "^6.2.0",
36
36
  "@types/hapi__joi": "17.1.8",
37
- "@umijs/babel-preset-umi": "4.0.8",
38
- "@umijs/bundler-utils": "4.0.8",
37
+ "@umijs/babel-preset-umi": "4.0.11",
38
+ "@umijs/bundler-utils": "4.0.11",
39
39
  "@umijs/case-sensitive-paths-webpack-plugin": "^1.0.1",
40
- "@umijs/mfsu": "4.0.8",
41
- "@umijs/utils": "4.0.8",
40
+ "@umijs/mfsu": "4.0.11",
41
+ "@umijs/utils": "4.0.11",
42
42
  "cors": "^2.8.5",
43
43
  "css-loader": "6.7.1",
44
44
  "es5-imcompatible-versions": "^0.1.73",
@@ -47,7 +47,8 @@
47
47
  "node-libs-browser": "2.2.1",
48
48
  "postcss": "^8.4.13",
49
49
  "postcss-preset-env": "7.5.0",
50
- "react-error-overlay": "6.0.9"
50
+ "react-error-overlay": "6.0.9",
51
+ "react-refresh": "0.14.0"
51
52
  },
52
53
  "devDependencies": {
53
54
  "@swc/core": "1.2.165",
@@ -67,7 +68,6 @@
67
68
  "postcss-flexbugs-fixes": "5.0.2",
68
69
  "postcss-loader": "6.2.1",
69
70
  "purgecss-webpack-plugin": "4.1.3",
70
- "react-refresh": "0.12.0",
71
71
  "sass-loader": "12.6.0",
72
72
  "schema-utils": "4.0.0",
73
73
  "speed-measure-webpack-plugin": "1.5.0",
@@ -120,8 +120,7 @@
120
120
  "webpack-manifest-plugin",
121
121
  "webpack-sources",
122
122
  "ws",
123
- "./bundles/webpack/bundle",
124
- "./bundles/react-refresh/babel"
123
+ "./bundles/webpack/bundle"
125
124
  ],
126
125
  "externals": {
127
126
  "@swc/core": "@swc/core",
@@ -173,7 +172,6 @@
173
172
  "postcss-flexbugs-fixes",
174
173
  "postcss-loader",
175
174
  "purgecss-webpack-plugin",
176
- "react-refresh",
177
175
  "sass-loader",
178
176
  "speed-measure-webpack-plugin",
179
177
  "style-loader",
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) Facebook, Inc. and its affiliates.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.