@rsbuild/plugin-svgr 1.0.0-alpha.2 → 1.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 +6 -3
- package/dist/index.js +5 -2
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -36,7 +36,7 @@ __export(src_exports, {
|
|
|
36
36
|
module.exports = __toCommonJS(src_exports);
|
|
37
37
|
var import_node_path = __toESM(require("path"));
|
|
38
38
|
var import_plugin_react = require("@rsbuild/plugin-react");
|
|
39
|
-
var
|
|
39
|
+
var import_deepmerge = __toESM(require("deepmerge"));
|
|
40
40
|
var SVG_REGEX = /\.svg$/;
|
|
41
41
|
function getSvgoDefaultConfig() {
|
|
42
42
|
return {
|
|
@@ -70,7 +70,7 @@ var pluginSvgr = (options = {}) => ({
|
|
|
70
70
|
chain.module.rules.delete(CHAIN_ID.RULE.SVG);
|
|
71
71
|
}
|
|
72
72
|
const rule = chain.module.rule(CHAIN_ID.RULE.SVG).test(SVG_REGEX);
|
|
73
|
-
const svgrOptions = (0,
|
|
73
|
+
const svgrOptions = (0, import_deepmerge.default)(
|
|
74
74
|
{
|
|
75
75
|
svgo: true,
|
|
76
76
|
svgoConfig: getSvgoDefaultConfig()
|
|
@@ -86,7 +86,10 @@ var pluginSvgr = (options = {}) => ({
|
|
|
86
86
|
const { mixedImport = false } = options;
|
|
87
87
|
if (mixedImport || svgrOptions.exportType) {
|
|
88
88
|
const { exportType = mixedImport ? "named" : void 0 } = svgrOptions;
|
|
89
|
-
const issuerInclude = [
|
|
89
|
+
const issuerInclude = [
|
|
90
|
+
/\.(?:js|jsx|mjs|cjs|ts|tsx|mts|cts)$/,
|
|
91
|
+
/\.mdx$/
|
|
92
|
+
];
|
|
90
93
|
const issuer = options.excludeImporter ? { and: [issuerInclude, { not: options.excludeImporter }] } : issuerInclude;
|
|
91
94
|
const svgRule = rule.oneOf(CHAIN_ID.ONE_OF.SVG);
|
|
92
95
|
if (options.exclude) {
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ var __dirname = /* @__PURE__ */ getDirname();
|
|
|
12
12
|
// src/index.ts
|
|
13
13
|
import path2 from "path";
|
|
14
14
|
import { PLUGIN_REACT_NAME } from "@rsbuild/plugin-react";
|
|
15
|
-
import
|
|
15
|
+
import deepmerge from "deepmerge";
|
|
16
16
|
var SVG_REGEX = /\.svg$/;
|
|
17
17
|
function getSvgoDefaultConfig() {
|
|
18
18
|
return {
|
|
@@ -62,7 +62,10 @@ var pluginSvgr = (options = {}) => ({
|
|
|
62
62
|
const { mixedImport = false } = options;
|
|
63
63
|
if (mixedImport || svgrOptions.exportType) {
|
|
64
64
|
const { exportType = mixedImport ? "named" : void 0 } = svgrOptions;
|
|
65
|
-
const issuerInclude = [
|
|
65
|
+
const issuerInclude = [
|
|
66
|
+
/\.(?:js|jsx|mjs|cjs|ts|tsx|mts|cts)$/,
|
|
67
|
+
/\.mdx$/
|
|
68
|
+
];
|
|
66
69
|
const issuer = options.excludeImporter ? { and: [issuerInclude, { not: options.excludeImporter }] } : issuerInclude;
|
|
67
70
|
const svgRule = rule.oneOf(CHAIN_ID.ONE_OF.SVG);
|
|
68
71
|
if (options.exclude) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-svgr",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.3",
|
|
4
4
|
"description": "svgr plugin for Rsbuild",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"@svgr/core": "8.1.0",
|
|
27
27
|
"@svgr/plugin-jsx": "8.1.0",
|
|
28
28
|
"@svgr/plugin-svgo": "8.1.0",
|
|
29
|
+
"deepmerge": "^4.3.1",
|
|
29
30
|
"loader-utils": "^2.0.4",
|
|
30
|
-
"@rsbuild/plugin-react": "1.0.0-alpha.
|
|
31
|
-
"@rsbuild/shared": "1.0.0-alpha.2"
|
|
31
|
+
"@rsbuild/plugin-react": "1.0.0-alpha.3"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/node": "18.x",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"prebundle": "1.1.0",
|
|
37
37
|
"typescript": "^5.5.2",
|
|
38
38
|
"url-loader": "4.1.1",
|
|
39
|
-
"@rsbuild/core": "1.0.0-alpha.
|
|
40
|
-
"@scripts/test-helper": "1.0.0-alpha.
|
|
39
|
+
"@rsbuild/core": "1.0.0-alpha.3",
|
|
40
|
+
"@scripts/test-helper": "1.0.0-alpha.3"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@rsbuild/core": "^1.0.0-alpha.
|
|
43
|
+
"@rsbuild/core": "^1.0.0-alpha.3"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public",
|