@umijs/bundler-webpack 4.0.33 → 4.0.35

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.
@@ -31,7 +31,8 @@ async function addBundleAnalyzerPlugin(opts) {
31
31
  analyzerPort: process.env.ANALYZE_PORT || 8888,
32
32
  openAnalyzer: false,
33
33
  logLevel: "info",
34
- defaultSizes: "parsed"
34
+ defaultSizes: "parsed",
35
+ ...opts.userConfig.analyze
35
36
  }
36
37
  ]);
37
38
  }
@@ -28,13 +28,19 @@ module.exports = __toCommonJS(speedMeasureWebpackPlugin_exports);
28
28
  var import_speed_measure_webpack_plugin = __toESM(require("@umijs/bundler-webpack/compiled/speed-measure-webpack-plugin"));
29
29
  var import_path = require("path");
30
30
  async function addSpeedMeasureWebpackPlugin(opts) {
31
+ var _a, _b;
31
32
  let webpackConfig = opts.webpackConfig;
32
33
  if (process.env.SPEED_MEASURE) {
34
+ const miniCssExtractPluginIdx = (_a = webpackConfig.plugins) == null ? void 0 : _a.findIndex((plugin) => plugin.constructor.name === "MiniCssExtractPlugin");
35
+ const miniCssExtractPlugin = (_b = webpackConfig.plugins) == null ? void 0 : _b[miniCssExtractPluginIdx];
33
36
  const smpOption = process.env.SPEED_MEASURE === "JSON" ? {
34
37
  outputFormat: "json",
35
38
  outputTarget: (0, import_path.join)(process.cwd(), "SPEED_MEASURE.json")
36
39
  } : { outputFormat: "human", outputTarget: console.log };
37
40
  webpackConfig = new import_speed_measure_webpack_plugin.default(smpOption).wrap(webpackConfig);
41
+ if (miniCssExtractPlugin) {
42
+ webpackConfig.plugins[miniCssExtractPluginIdx] = miniCssExtractPlugin;
43
+ }
38
44
  }
39
45
  return webpackConfig;
40
46
  }
package/dist/dev.js CHANGED
@@ -80,7 +80,8 @@ async function dev(opts) {
80
80
  publicPath: opts.config.publicPath
81
81
  });
82
82
  },
83
- startBuildWorker: opts.startBuildWorker
83
+ startBuildWorker: opts.startBuildWorker,
84
+ cwd: opts.cwd
84
85
  });
85
86
  }
86
87
  const webpackConfig = await (0, import_config.getConfig)({
@@ -1,4 +1,6 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ /// <reference types="node" />
2
4
  import type { SpdyServer as Server } from '@umijs/bundler-utils';
3
5
  import { Server as HttpServer } from 'http';
4
6
  import { Http2Server } from 'http2';
package/dist/types.d.ts CHANGED
@@ -117,6 +117,7 @@ export interface IConfig {
117
117
  };
118
118
  writeToDisk?: boolean;
119
119
  babelLoaderCustomize?: string;
120
+ analyze?: Record<string, any>;
120
121
  [key: string]: any;
121
122
  }
122
123
  export interface SwcOptions extends SwcConfig {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/bundler-webpack",
3
- "version": "4.0.33",
3
+ "version": "4.0.35",
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",
@@ -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.33",
38
- "@umijs/bundler-utils": "4.0.33",
37
+ "@umijs/babel-preset-umi": "4.0.35",
38
+ "@umijs/bundler-utils": "4.0.35",
39
39
  "@umijs/case-sensitive-paths-webpack-plugin": "^1.0.1",
40
- "@umijs/mfsu": "4.0.33",
41
- "@umijs/utils": "4.0.33",
40
+ "@umijs/mfsu": "4.0.35",
41
+ "@umijs/utils": "4.0.35",
42
42
  "cors": "^2.8.5",
43
43
  "css-loader": "6.7.1",
44
44
  "es5-imcompatible-versions": "^0.1.73",