@rsbuild/plugin-svgr 0.7.0-beta.4 → 0.7.0-beta.6

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.cjs CHANGED
@@ -30,12 +30,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var src_exports = {};
32
32
  __export(src_exports, {
33
+ SVG_REGEX: () => SVG_REGEX,
33
34
  pluginSvgr: () => pluginSvgr
34
35
  });
35
36
  module.exports = __toCommonJS(src_exports);
36
37
  var import_node_path = __toESM(require("path"));
37
38
  var import_plugin_react = require("@rsbuild/plugin-react");
38
39
  var import_shared = require("@rsbuild/shared");
40
+ var SVG_REGEX = /\.svg$/;
39
41
  function getSvgoDefaultConfig() {
40
42
  return {
41
43
  plugins: [
@@ -69,7 +71,7 @@ var pluginSvgr = (options = {}) => ({
69
71
  generatorOptions = chain.module.rules.get(CHAIN_ID.RULE.SVG).oneOfs.get(CHAIN_ID.ONE_OF.SVG_URL).get("generator");
70
72
  chain.module.rules.delete(CHAIN_ID.RULE.SVG);
71
73
  }
72
- const rule = chain.module.rule(CHAIN_ID.RULE.SVG).test(import_shared.SVG_REGEX);
74
+ const rule = chain.module.rule(CHAIN_ID.RULE.SVG).test(SVG_REGEX);
73
75
  const svgrOptions = (0, import_shared.deepmerge)(
74
76
  {
75
77
  svgo: true,
@@ -131,5 +133,6 @@ var pluginSvgr = (options = {}) => ({
131
133
  });
132
134
  // Annotate the CommonJS export names for ESM import in node:
133
135
  0 && (module.exports = {
136
+ SVG_REGEX,
134
137
  pluginSvgr
135
138
  });
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import { Rspack, RsbuildPlugin } from '@rsbuild/core';
2
2
  import { Config } from '@svgr/core';
3
3
 
4
4
  type SvgDefaultExport = 'component' | 'url';
5
+ declare const SVG_REGEX: RegExp;
5
6
  type PluginSvgrOptions = {
6
7
  /**
7
8
  * Configure SVGR options.
@@ -29,4 +30,4 @@ type PluginSvgrOptions = {
29
30
  };
30
31
  declare const pluginSvgr: (options?: PluginSvgrOptions) => RsbuildPlugin;
31
32
 
32
- export { type PluginSvgrOptions, type SvgDefaultExport, pluginSvgr };
33
+ export { type PluginSvgrOptions, SVG_REGEX, type SvgDefaultExport, pluginSvgr };
package/dist/index.js CHANGED
@@ -14,11 +14,11 @@ import path2 from "path";
14
14
  import { PLUGIN_REACT_NAME } from "@rsbuild/plugin-react";
15
15
  import {
16
16
  SCRIPT_REGEX,
17
- SVG_REGEX,
18
17
  deepmerge,
19
18
  getDistPath,
20
19
  getFilename as getFilename2
21
20
  } from "@rsbuild/shared";
21
+ var SVG_REGEX = /\.svg$/;
22
22
  function getSvgoDefaultConfig() {
23
23
  return {
24
24
  plugins: [
@@ -113,5 +113,6 @@ var pluginSvgr = (options = {}) => ({
113
113
  }
114
114
  });
115
115
  export {
116
+ SVG_REGEX,
116
117
  pluginSvgr
117
118
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-svgr",
3
- "version": "0.7.0-beta.4",
3
+ "version": "0.7.0-beta.6",
4
4
  "description": "svgr plugin for Rsbuild",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,8 +26,8 @@
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/plugin-react": "0.7.0-beta.4",
30
- "@rsbuild/shared": "0.7.0-beta.4"
29
+ "@rsbuild/plugin-react": "0.7.0-beta.6",
30
+ "@rsbuild/shared": "0.7.0-beta.6"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "18.x",
@@ -35,11 +35,11 @@
35
35
  "prebundle": "1.1.0",
36
36
  "typescript": "^5.4.2",
37
37
  "url-loader": "4.1.1",
38
- "@rsbuild/core": "0.7.0-beta.4",
39
- "@scripts/test-helper": "0.7.0-beta.4"
38
+ "@rsbuild/core": "0.7.0-beta.6",
39
+ "@scripts/test-helper": "0.7.0-beta.6"
40
40
  },
41
41
  "peerDependencies": {
42
- "@rsbuild/core": "^0.7.0-beta.4"
42
+ "@rsbuild/core": "^0.7.0-beta.6"
43
43
  },
44
44
  "publishConfig": {
45
45
  "access": "public",