@rsbuild/plugin-svgr 0.4.6 → 0.4.8

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
@@ -74,13 +74,9 @@ var pluginSvgr = (options = {}) => ({
74
74
  assetType,
75
75
  issuer: {
76
76
  // The issuer option ensures that SVGR will only apply if the SVG is imported from a JS file.
77
- not: [import_shared.JS_REGEX, import_shared.TS_REGEX]
77
+ not: [import_shared.SCRIPT_REGEX]
78
78
  }
79
79
  });
80
- rule.oneOf(CHAIN_ID.ONE_OF.SVG_INLINE).type("asset/inline").resourceQuery(/inline/);
81
- rule.oneOf(CHAIN_ID.ONE_OF.SVG_URL).type("asset/resource").resourceQuery(/url/).set("generator", {
82
- filename: outputName
83
- });
84
80
  const jsRule = chain.module.rules.get(CHAIN_ID.RULE.JS);
85
81
  const svgrRule = rule.oneOf(CHAIN_ID.ONE_OF.SVG).type("javascript/auto");
86
82
  [CHAIN_ID.USE.SWC, CHAIN_ID.USE.BABEL].some((id) => {
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ import { createRequire } from 'module';
2
2
  var require = createRequire(import.meta['url']);
3
3
 
4
4
 
5
- // ../../node_modules/.pnpm/@modern-js+module-tools@2.47.0_typescript@5.3.2/node_modules/@modern-js/module-tools/shims/esm.js
5
+ // ../../node_modules/.pnpm/@modern-js+module-tools@2.47.1_typescript@5.3.2/node_modules/@modern-js/module-tools/shims/esm.js
6
6
  import { fileURLToPath } from "url";
7
7
  import path from "path";
8
8
  var getFilename = () => fileURLToPath(import.meta.url);
@@ -12,12 +12,11 @@ var __dirname = /* @__PURE__ */ getDirname();
12
12
  // src/index.ts
13
13
  import path2 from "path";
14
14
  import {
15
- JS_REGEX,
16
- TS_REGEX,
17
15
  SVG_REGEX,
18
16
  deepmerge,
19
17
  getDistPath,
20
18
  getFilename as getFilename2,
19
+ SCRIPT_REGEX,
21
20
  chainStaticAssetRule
22
21
  } from "@rsbuild/shared";
23
22
  import { PLUGIN_REACT_NAME } from "@rsbuild/plugin-react";
@@ -59,13 +58,9 @@ var pluginSvgr = (options = {}) => ({
59
58
  assetType,
60
59
  issuer: {
61
60
  // The issuer option ensures that SVGR will only apply if the SVG is imported from a JS file.
62
- not: [JS_REGEX, TS_REGEX]
61
+ not: [SCRIPT_REGEX]
63
62
  }
64
63
  });
65
- rule.oneOf(CHAIN_ID.ONE_OF.SVG_INLINE).type("asset/inline").resourceQuery(/inline/);
66
- rule.oneOf(CHAIN_ID.ONE_OF.SVG_URL).type("asset/resource").resourceQuery(/url/).set("generator", {
67
- filename: outputName
68
- });
69
64
  const jsRule = chain.module.rules.get(CHAIN_ID.RULE.JS);
70
65
  const svgrRule = rule.oneOf(CHAIN_ID.ONE_OF.SVG).type("javascript/auto");
71
66
  [CHAIN_ID.USE.SWC, CHAIN_ID.USE.BABEL].some((id) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-svgr",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
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.6",
30
- "@rsbuild/plugin-react": "0.4.6"
29
+ "@rsbuild/shared": "0.4.8",
30
+ "@rsbuild/plugin-react": "0.4.8"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "16.x",
34
34
  "typescript": "^5.3.0",
35
- "@rsbuild/core": "0.4.6",
36
- "@scripts/test-helper": "0.4.6"
35
+ "@rsbuild/core": "0.4.8",
36
+ "@scripts/test-helper": "0.4.8"
37
37
  },
38
38
  "peerDependencies": {
39
- "@rsbuild/core": "^0.4.6"
39
+ "@rsbuild/core": "^0.4.8"
40
40
  },
41
41
  "publishConfig": {
42
42
  "access": "public",