@umijs/bundler-utoopack 4.6.59 → 4.6.61

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 (2) hide show
  1. package/dist/config.js +25 -4
  2. package/package.json +4 -4
package/dist/config.js CHANGED
@@ -465,8 +465,23 @@ function mergeExtraPostcssPlugins(postcssConfig, extraPlugins = []) {
465
465
  );
466
466
  }, postcssConfig);
467
467
  }
468
- function getUserUtoopackConfig(utoopackConfig = {}) {
469
- return import_utils.lodash.omit(utoopackConfig, ["babelLoader", "root"]);
468
+ function getUserUtoopackConfig(utoopackConfig = {}, opts) {
469
+ var _a, _b;
470
+ const userUtoopackConfig = import_utils.lodash.omit(utoopackConfig, [
471
+ "babelLoader",
472
+ "root"
473
+ ]);
474
+ const packageImports = ((_a = userUtoopackConfig.optimization) == null ? void 0 : _a.packageImports) || [];
475
+ if (((_b = opts.config.antd) == null ? void 0 : _b.import) && opts.modularizeImports.antd && Array.isArray(packageImports) && packageImports.includes("antd")) {
476
+ return {
477
+ ...userUtoopackConfig,
478
+ optimization: {
479
+ ...userUtoopackConfig.optimization,
480
+ packageImports: packageImports.filter((pkg) => pkg !== "antd")
481
+ }
482
+ };
483
+ }
484
+ return userUtoopackConfig;
470
485
  }
471
486
  function getDefaultPersistentCaching() {
472
487
  return process.platform !== "win32";
@@ -520,7 +535,10 @@ async function getProdUtooPackConfig(rawOpts) {
520
535
  inlineLimit,
521
536
  mdx
522
537
  } = opts.config;
523
- const userUtoopackConfig = getUserUtoopackConfig(opts.config.utoopack);
538
+ const userUtoopackConfig = getUserUtoopackConfig(opts.config.utoopack, {
539
+ config: opts.config,
540
+ modularizeImports
541
+ });
524
542
  utooBundlerOpts = {
525
543
  ...utooBundlerOpts,
526
544
  tracing: false,
@@ -654,7 +672,10 @@ async function getDevUtooPackConfig(rawOpts) {
654
672
  inlineLimit,
655
673
  mdx
656
674
  } = opts.config;
657
- const userUtoopackConfig = getUserUtoopackConfig(opts.config.utoopack);
675
+ const userUtoopackConfig = getUserUtoopackConfig(opts.config.utoopack, {
676
+ config: opts.config,
677
+ modularizeImports
678
+ });
658
679
  utooBundlerOpts = {
659
680
  ...utooBundlerOpts,
660
681
  ...process.env.SOCKET_SERVER ? {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/bundler-utoopack",
3
- "version": "4.6.59",
3
+ "version": "4.6.61",
4
4
  "description": "@umijs/bundler-utoopack",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,7 +8,7 @@
8
8
  "dist"
9
9
  ],
10
10
  "dependencies": {
11
- "@utoo/pack": "1.4.11",
11
+ "@utoo/pack": "1.4.12",
12
12
  "compression": "^1.7.4",
13
13
  "connect-history-api-fallback": "^2.0.0",
14
14
  "cors": "^2.8.5",
@@ -20,8 +20,8 @@
20
20
  "resolve-url-loader": "5.0.0",
21
21
  "sass": "1.54.0",
22
22
  "sass-loader": "13.2.0",
23
- "@umijs/bundler-webpack": "4.6.59",
24
- "@umijs/bundler-utils": "4.6.59"
23
+ "@umijs/bundler-utils": "4.6.61",
24
+ "@umijs/bundler-webpack": "4.6.61"
25
25
  },
26
26
  "devDependencies": {
27
27
  "father": "4.1.5"