@umijs/bundler-webpack 4.0.1 → 4.0.2

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.
@@ -14,9 +14,6 @@ async function addAssetRules(opts) {
14
14
  dataUrlCondition: {
15
15
  maxSize: inlineLimit,
16
16
  },
17
- })
18
- .generator({
19
- filename: `${opts.staticPathPrefix}[name].[hash:8].[ext]`,
20
17
  });
21
18
  rule
22
19
  .oneOf('image')
@@ -26,9 +23,6 @@ async function addAssetRules(opts) {
26
23
  dataUrlCondition: {
27
24
  maxSize: inlineLimit,
28
25
  },
29
- })
30
- .generator({
31
- filename: `${opts.staticPathPrefix}[name].[hash:8].[ext]`,
32
26
  });
33
27
  const fallback = rule
34
28
  .oneOf('fallback')
@@ -40,11 +34,6 @@ async function addAssetRules(opts) {
40
34
  if (userConfig.mdx) {
41
35
  fallback.add(/\.mdx?$/);
42
36
  }
43
- fallback
44
- .end()
45
- .type('asset/resource')
46
- .generator({
47
- filename: `${opts.staticPathPrefix}[name].[hash:8].[ext]`,
48
- });
37
+ fallback.end().type('asset/resource');
49
38
  }
50
39
  exports.addAssetRules = addAssetRules;
@@ -78,7 +78,8 @@ async function getConfig(opts) {
78
78
  .filename(useHash ? `[name].[contenthash:8].js` : `[name].js`)
79
79
  .chunkFilename(useHash ? `[name].[contenthash:8].async.js` : `[name].async.js`)
80
80
  .publicPath(userConfig.publicPath || 'auto')
81
- .pathinfo(isDev || disableCompress);
81
+ .pathinfo(isDev || disableCompress)
82
+ .set('assetModuleFilename', `${applyOpts.staticPathPrefix}[name].[hash:8][ext]`);
82
83
  // resolve
83
84
  // prettier-ignore
84
85
  config.resolve
@@ -35,20 +35,14 @@ async function addSVGRules(opts) {
35
35
  .loader(require.resolve('@umijs/bundler-webpack/compiled/url-loader'))
36
36
  .end();
37
37
  }
38
- if (svgo === false) {
38
+ if (svgo !== false) {
39
39
  const svgRule = config.module.rule('svg');
40
40
  svgRule
41
41
  .test(/\.svg$/)
42
- .use('url-loader')
43
- .loader(require.resolve('@umijs/bundler-webpack/compiled/url-loader'));
44
- return;
42
+ .use('svgo-loader')
43
+ .loader(require.resolve('@umijs/bundler-webpack/compiled/svgo-loader'))
44
+ .options({ configFile: false, ...svgo })
45
+ .end();
45
46
  }
46
- const svgRule = config.module.rule('svg');
47
- svgRule
48
- .test(/\.svg$/)
49
- .use('svgo-loader')
50
- .loader(require.resolve('@umijs/bundler-webpack/compiled/svgo-loader'))
51
- .options({ configFile: false, ...svgo })
52
- .end();
53
47
  }
54
48
  exports.addSVGRules = addSVGRules;
package/dist/schema.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- /// <reference types="hapi__joi" />
2
- import type { Root } from '@hapi/joi';
1
+ import type { Root } from '@umijs/utils/compiled/@hapi/joi';
3
2
  export declare function getSchemas(): Record<string, (Joi: Root) => any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/bundler-webpack",
3
- "version": "4.0.1",
3
+ "version": "4.0.2",
4
4
  "description": "@umijs/bundler-webpack",
5
5
  "homepage": "https://github.com/umijs/umi-next/tree/master/packages/bundler-webpack#readme",
6
6
  "bugs": "https://github.com/umijs/umi-next/issues",
@@ -24,7 +24,7 @@
24
24
  "build": "pnpm tsc",
25
25
  "build:client": "pnpm tsc --project ./tsconfig.client.json",
26
26
  "build:deps": "umi-scripts bundleDeps",
27
- "dev": "pnpm build -- --watch",
27
+ "dev": "pnpm build --watch",
28
28
  "generate:webpackPackages": "zx ./scripts/generateWebpackPackages.mjs",
29
29
  "test": "umi-scripts jest-turbo"
30
30
  },
@@ -35,10 +35,10 @@
35
35
  "@svgr/plugin-jsx": "^6.2.1",
36
36
  "@svgr/plugin-svgo": "^6.2.0",
37
37
  "@types/hapi__joi": "17.1.8",
38
- "@umijs/babel-preset-umi": "4.0.1",
39
- "@umijs/bundler-utils": "4.0.1",
40
- "@umijs/mfsu": "4.0.1",
41
- "@umijs/utils": "4.0.1",
38
+ "@umijs/babel-preset-umi": "4.0.2",
39
+ "@umijs/bundler-utils": "4.0.2",
40
+ "@umijs/mfsu": "4.0.2",
41
+ "@umijs/utils": "4.0.2",
42
42
  "cors": "^2.8.5",
43
43
  "css-loader": "6.7.1",
44
44
  "es5-imcompatible-versions": "^0.1.73",