@rsbuild/plugin-svgr 0.4.12 → 0.4.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.
package/dist/index.js CHANGED
@@ -64,7 +64,8 @@ var pluginSvgr = (options = {}) => ({
64
64
  const distDir = (0, import_shared.getDistPath)(config, assetType);
65
65
  const filename = (0, import_shared.getFilename)(config, assetType, isProd);
66
66
  const outputName = import_node_path.default.posix.join(distDir, filename);
67
- const maxSize = config.output.dataUriLimit[assetType];
67
+ const { dataUriLimit } = config.output;
68
+ const maxSize = typeof dataUriLimit === "number" ? dataUriLimit : dataUriLimit[assetType];
68
69
  chain.module.rules.delete(CHAIN_ID.RULE.SVG);
69
70
  const rule = chain.module.rule(CHAIN_ID.RULE.SVG).test(import_shared.SVG_REGEX);
70
71
  (0, import_shared.chainStaticAssetRule)({
@@ -97,7 +98,7 @@ var pluginSvgr = (options = {}) => ({
97
98
  svgrRule.use(CHAIN_ID.USE.SVGR).loader(import_node_path.default.resolve(__dirname, "./loader")).options(svgrOptions).end().when(
98
99
  svgDefaultExport === "url",
99
100
  (c) => c.use(CHAIN_ID.USE.URL).loader(import_node_path.default.join(__dirname, "../compiled", "url-loader")).options({
100
- limit: config.output.dataUriLimit.svg,
101
+ limit: maxSize,
101
102
  name: outputName
102
103
  })
103
104
  );
package/dist/index.mjs CHANGED
@@ -48,7 +48,8 @@ var pluginSvgr = (options = {}) => ({
48
48
  const distDir = getDistPath(config, assetType);
49
49
  const filename = getFilename2(config, assetType, isProd);
50
50
  const outputName = path2.posix.join(distDir, filename);
51
- const maxSize = config.output.dataUriLimit[assetType];
51
+ const { dataUriLimit } = config.output;
52
+ const maxSize = typeof dataUriLimit === "number" ? dataUriLimit : dataUriLimit[assetType];
52
53
  chain.module.rules.delete(CHAIN_ID.RULE.SVG);
53
54
  const rule = chain.module.rule(CHAIN_ID.RULE.SVG).test(SVG_REGEX);
54
55
  chainStaticAssetRule({
@@ -81,7 +82,7 @@ var pluginSvgr = (options = {}) => ({
81
82
  svgrRule.use(CHAIN_ID.USE.SVGR).loader(path2.resolve(__dirname, "./loader")).options(svgrOptions).end().when(
82
83
  svgDefaultExport === "url",
83
84
  (c) => c.use(CHAIN_ID.USE.URL).loader(path2.join(__dirname, "../compiled", "url-loader")).options({
84
- limit: config.output.dataUriLimit.svg,
85
+ limit: maxSize,
85
86
  name: outputName
86
87
  })
87
88
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-svgr",
3
- "version": "0.4.12",
3
+ "version": "0.4.13",
4
4
  "description": "svgr plugin for Rsbuild",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,17 +26,17 @@
26
26
  "@svgr/core": "8.1.0",
27
27
  "@svgr/plugin-jsx": "8.1.0",
28
28
  "@svgr/plugin-svgo": "8.1.0",
29
- "@rsbuild/shared": "0.4.12",
30
- "@rsbuild/plugin-react": "0.4.12"
29
+ "@rsbuild/shared": "0.4.13",
30
+ "@rsbuild/plugin-react": "0.4.13"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "16.x",
34
- "typescript": "^5.3.0",
35
- "@rsbuild/core": "0.4.12",
36
- "@scripts/test-helper": "0.4.12"
34
+ "typescript": "^5.4.2",
35
+ "@rsbuild/core": "0.4.13",
36
+ "@scripts/test-helper": "0.4.13"
37
37
  },
38
38
  "peerDependencies": {
39
- "@rsbuild/core": "^0.4.12"
39
+ "@rsbuild/core": "^0.4.13"
40
40
  },
41
41
  "publishConfig": {
42
42
  "access": "public",