@rsbuild/plugin-svgr 2.0.4 → 2.0.5
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.d.ts +8 -5
- package/dist/index.js +3 -1
- package/package.json +7 -3
package/dist/index.d.ts
CHANGED
|
@@ -21,11 +21,14 @@ export type PluginSvgrOptions = {
|
|
|
21
21
|
* @default /react/
|
|
22
22
|
*/ query?: RegExp;
|
|
23
23
|
/**
|
|
24
|
-
* Whether to
|
|
25
|
-
* threads. When enabled,
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
24
|
+
* Whether to transform SVG modules into React components in parallel using worker
|
|
25
|
+
* threads. When enabled, SVG modules are processed across multiple worker threads,
|
|
26
|
+
* reducing pressure on the main thread and improving overall build performance
|
|
27
|
+
* when compiling large numbers of SVG modules.
|
|
28
|
+
*
|
|
29
|
+
* Options transferred to worker threads must comply with the HTML structured clone
|
|
30
|
+
* algorithm. For example, functions cannot be passed as options.
|
|
31
|
+
* @see https://nodejs.org/api/worker_threads.html#portpostmessagevalue-transferlist
|
|
29
32
|
* @default false
|
|
30
33
|
*/ parallel?: boolean;
|
|
31
34
|
/**
|
package/dist/index.js
CHANGED
|
@@ -49,7 +49,9 @@ let pluginSvgr = (options = {})=>({
|
|
|
49
49
|
mergedPlugins = mergedPlugins.map((item)=>'object' == typeof item && item.name === plugin.name ? (isMerged = !0, deepmerge(item, plugin)) : item), isMerged || mergedPlugins.push(plugin);
|
|
50
50
|
}
|
|
51
51
|
return config.plugins = mergedPlugins, config;
|
|
52
|
-
})(svgrOptions.svgoConfig), rule.oneOf(CHAIN_ID.ONE_OF.SVG_URL).type('asset/resource').resourceQuery(/^\?url$/).set('generator', generatorOptions), rule.oneOf(CHAIN_ID.ONE_OF.SVG_INLINE).type('asset/inline').resourceQuery(/^\?inline$/), CHAIN_ID.ONE_OF.
|
|
52
|
+
})(svgrOptions.svgoConfig), rule.oneOf(CHAIN_ID.ONE_OF.SVG_URL).type('asset/resource').resourceQuery(/^\?url$/).set('generator', generatorOptions), rule.oneOf(CHAIN_ID.ONE_OF.SVG_INLINE).type('asset/inline').resourceQuery(/^\?inline$/), CHAIN_ID.ONE_OF.SVG_TEXT && rule.oneOf(CHAIN_ID.ONE_OF.SVG_TEXT).type('asset/source').with({
|
|
53
|
+
type: 'text'
|
|
54
|
+
}), CHAIN_ID.ONE_OF.SVG_RAW && rule.oneOf(CHAIN_ID.ONE_OF.SVG_RAW).type('asset/source').resourceQuery(/^\?raw$/);
|
|
53
55
|
let svgReactUse = rule.oneOf(CHAIN_ID.ONE_OF.SVG_REACT).type("javascript/auto").resourceQuery(options.query || /react/).use(CHAIN_ID.USE.SVGR).loader(node_path.join(import.meta.dirname, 'loader.mjs')).options({
|
|
54
56
|
...svgrOptions,
|
|
55
57
|
exportType: 'default'
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-svgr",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "SVGR plugin for Rsbuild",
|
|
5
|
+
"homepage": "https://rsbuild.rs",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/web-infra-dev/rsbuild/issues"
|
|
8
|
+
},
|
|
5
9
|
"license": "MIT",
|
|
6
10
|
"repository": {
|
|
7
11
|
"type": "git",
|
|
@@ -33,11 +37,11 @@
|
|
|
33
37
|
},
|
|
34
38
|
"devDependencies": {
|
|
35
39
|
"@rsbuild/core-v1": "npm:@rsbuild/core@^1.7.5",
|
|
36
|
-
"@rslib/core": "0.
|
|
40
|
+
"@rslib/core": "0.23.1",
|
|
37
41
|
"@types/node": "^24.13.2",
|
|
38
42
|
"svgo": "^3.3.3",
|
|
39
43
|
"typescript": "^6.0.3",
|
|
40
|
-
"@rsbuild/core": "2.
|
|
44
|
+
"@rsbuild/core": "2.1.2",
|
|
41
45
|
"@scripts/test-helper": "1.0.0"
|
|
42
46
|
},
|
|
43
47
|
"peerDependencies": {
|