@rsbuild/plugin-svgr 1.3.0 → 2.0.0-alpha.3
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 +3 -3
- package/dist/index.js +3 -3
- package/package.json +3 -4
package/dist/index.cjs
CHANGED
|
@@ -69,7 +69,7 @@ const src_dirname = external_node_path_default().dirname((0, external_node_url_n
|
|
|
69
69
|
svgo: !0,
|
|
70
70
|
svgoConfig: getSvgoDefaultConfig()
|
|
71
71
|
}, options.svgrOptions || {});
|
|
72
|
-
svgrOptions.svgoConfig = dedupeSvgoPlugins(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_RAW && rule.oneOf(CHAIN_ID.ONE_OF.SVG_RAW).type('asset/source').resourceQuery(/^\?raw$/), rule.oneOf(CHAIN_ID.ONE_OF.SVG_REACT).type("javascript/auto").resourceQuery(options.query || /react/).use(CHAIN_ID.USE.SVGR).loader(external_node_path_default().resolve(src_dirname, './loader.mjs')).options({
|
|
72
|
+
svgrOptions.svgoConfig = dedupeSvgoPlugins(svgrOptions.svgoConfig), rule.oneOf(CHAIN_ID.ONE_OF.SVG_URL).type('asset/resource').resourceQuery(/^\?(__inline=false|url)$/).set('generator', generatorOptions), rule.oneOf(CHAIN_ID.ONE_OF.SVG_INLINE).type('asset/inline').resourceQuery(/^\?inline$/), CHAIN_ID.ONE_OF.SVG_RAW && rule.oneOf(CHAIN_ID.ONE_OF.SVG_RAW).type('asset/source').resourceQuery(/^\?raw$/), rule.oneOf(CHAIN_ID.ONE_OF.SVG_REACT).type("javascript/auto").resourceQuery(options.query || /react/).use(CHAIN_ID.USE.SVGR).loader(external_node_path_default().resolve(src_dirname, './loader.mjs')).options({
|
|
73
73
|
...svgrOptions,
|
|
74
74
|
exportType: 'default'
|
|
75
75
|
}).end();
|
|
@@ -99,12 +99,12 @@ const src_dirname = external_node_path_default().dirname((0, external_node_url_n
|
|
|
99
99
|
maxSize
|
|
100
100
|
}
|
|
101
101
|
}).set('generator', generatorOptions);
|
|
102
|
-
let
|
|
102
|
+
let jsRule = chain.module.rules.get(CHAIN_ID.RULE.JS).oneOfs.get(CHAIN_ID.ONE_OF.JS_MAIN);
|
|
103
103
|
[
|
|
104
104
|
CHAIN_ID.USE.SWC,
|
|
105
105
|
CHAIN_ID.USE.BABEL
|
|
106
106
|
].some((jsUseId)=>{
|
|
107
|
-
let use =
|
|
107
|
+
let use = jsRule.uses.get(jsUseId);
|
|
108
108
|
if (!use) return !1;
|
|
109
109
|
for (let oneOfId of [
|
|
110
110
|
CHAIN_ID.ONE_OF.SVG,
|
package/dist/index.js
CHANGED
|
@@ -44,7 +44,7 @@ let src_dirname = node_path.dirname(fileURLToPath(import.meta.url)), SVG_REGEX =
|
|
|
44
44
|
mergedPlugins = mergedPlugins.map((item)=>'object' == typeof item && item.name === plugin.name ? (isMerged = !0, deepmerge(item, plugin)) : item), isMerged || mergedPlugins.push(plugin);
|
|
45
45
|
}
|
|
46
46
|
return config.plugins = mergedPlugins, config;
|
|
47
|
-
})(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_RAW && rule.oneOf(CHAIN_ID.ONE_OF.SVG_RAW).type('asset/source').resourceQuery(/^\?raw$/), rule.oneOf(CHAIN_ID.ONE_OF.SVG_REACT).type("javascript/auto").resourceQuery(options.query || /react/).use(CHAIN_ID.USE.SVGR).loader(node_path.resolve(src_dirname, './loader.mjs')).options({
|
|
47
|
+
})(svgrOptions.svgoConfig), rule.oneOf(CHAIN_ID.ONE_OF.SVG_URL).type('asset/resource').resourceQuery(/^\?(__inline=false|url)$/).set('generator', generatorOptions), rule.oneOf(CHAIN_ID.ONE_OF.SVG_INLINE).type('asset/inline').resourceQuery(/^\?inline$/), CHAIN_ID.ONE_OF.SVG_RAW && rule.oneOf(CHAIN_ID.ONE_OF.SVG_RAW).type('asset/source').resourceQuery(/^\?raw$/), rule.oneOf(CHAIN_ID.ONE_OF.SVG_REACT).type("javascript/auto").resourceQuery(options.query || /react/).use(CHAIN_ID.USE.SVGR).loader(node_path.resolve(src_dirname, './loader.mjs')).options({
|
|
48
48
|
...svgrOptions,
|
|
49
49
|
exportType: 'default'
|
|
50
50
|
}).end();
|
|
@@ -74,12 +74,12 @@ let src_dirname = node_path.dirname(fileURLToPath(import.meta.url)), SVG_REGEX =
|
|
|
74
74
|
maxSize
|
|
75
75
|
}
|
|
76
76
|
}).set('generator', generatorOptions);
|
|
77
|
-
let
|
|
77
|
+
let jsRule = chain.module.rules.get(CHAIN_ID.RULE.JS).oneOfs.get(CHAIN_ID.ONE_OF.JS_MAIN);
|
|
78
78
|
[
|
|
79
79
|
CHAIN_ID.USE.SWC,
|
|
80
80
|
CHAIN_ID.USE.BABEL
|
|
81
81
|
].some((jsUseId)=>{
|
|
82
|
-
let use =
|
|
82
|
+
let use = jsRule.uses.get(jsUseId);
|
|
83
83
|
if (!use) return !1;
|
|
84
84
|
for (let oneOfId of [
|
|
85
85
|
CHAIN_ID.ONE_OF.SVG,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-svgr",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.3",
|
|
4
4
|
"description": "SVGR plugin for Rsbuild",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"compiled"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@rsbuild/plugin-react": "^
|
|
26
|
+
"@rsbuild/plugin-react": "^2.0.0-0",
|
|
27
27
|
"@svgr/core": "8.1.0",
|
|
28
28
|
"@svgr/plugin-jsx": "8.1.0",
|
|
29
29
|
"@svgr/plugin-svgo": "8.1.0",
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
"loader-utils": "^3.3.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@rsbuild/core-v1": "npm:@rsbuild/core@^1.7.2",
|
|
35
34
|
"@rslib/core": "0.19.3",
|
|
36
35
|
"@types/node": "^24.10.9",
|
|
37
36
|
"file-loader": "6.2.0",
|
|
@@ -43,7 +42,7 @@
|
|
|
43
42
|
"@scripts/test-helper": "1.0.1"
|
|
44
43
|
},
|
|
45
44
|
"peerDependencies": {
|
|
46
|
-
"@rsbuild/core": "^
|
|
45
|
+
"@rsbuild/core": "^2.0.0-0"
|
|
47
46
|
},
|
|
48
47
|
"publishConfig": {
|
|
49
48
|
"access": "public",
|