@promoboxx/react-scripts-vite 0.2.2 → 0.2.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/cjs/viteConfig.js +31 -0
- package/dist/esm/viteConfig.mjs +31 -0
- package/package.json +3 -1
package/dist/cjs/viteConfig.js
CHANGED
|
@@ -56,6 +56,37 @@ var pluginOptions = {
|
|
|
56
56
|
},
|
|
57
57
|
react: {
|
|
58
58
|
jsxRuntime: process.env.DISABLE_NEW_JSX_TRANSFORM === "true" ? "classic" : void 0
|
|
59
|
+
},
|
|
60
|
+
svgr: {
|
|
61
|
+
svgrOptions: {
|
|
62
|
+
titleProp: true,
|
|
63
|
+
descProp: true,
|
|
64
|
+
ref: true,
|
|
65
|
+
memo: true,
|
|
66
|
+
// It's not obvious, but these plugins are needed to just be able to pass
|
|
67
|
+
// options to svgo, and they're not really documented in svgr.
|
|
68
|
+
// https://github.com/pd4d10/vite-plugin-svgr/blob/57873c10f9be1484517b90e2dfbe2e23fa62a183/README.md?plain=1#L66-L78
|
|
69
|
+
plugins: ["@svgr/plugin-svgo", "@svgr/plugin-jsx"],
|
|
70
|
+
svgo: true,
|
|
71
|
+
// Stop svgr from touching dimensions / viewBox / the svgo config.
|
|
72
|
+
dimensions: false,
|
|
73
|
+
svgoConfig: {
|
|
74
|
+
plugins: [
|
|
75
|
+
{
|
|
76
|
+
name: "preset-default",
|
|
77
|
+
params: {
|
|
78
|
+
overrides: {
|
|
79
|
+
// Don't remove viewBox if it exists in the svg.
|
|
80
|
+
removeViewBox: false
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
// Finally, remove dimensions, and more importantly, set a viewBox if
|
|
85
|
+
// it doesn't exist.
|
|
86
|
+
"removeDimensions"
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
}
|
|
59
90
|
}
|
|
60
91
|
};
|
|
61
92
|
var viteConfig = () => {
|
package/dist/esm/viteConfig.mjs
CHANGED
|
@@ -21,6 +21,37 @@ var pluginOptions = {
|
|
|
21
21
|
},
|
|
22
22
|
react: {
|
|
23
23
|
jsxRuntime: process.env.DISABLE_NEW_JSX_TRANSFORM === "true" ? "classic" : void 0
|
|
24
|
+
},
|
|
25
|
+
svgr: {
|
|
26
|
+
svgrOptions: {
|
|
27
|
+
titleProp: true,
|
|
28
|
+
descProp: true,
|
|
29
|
+
ref: true,
|
|
30
|
+
memo: true,
|
|
31
|
+
// It's not obvious, but these plugins are needed to just be able to pass
|
|
32
|
+
// options to svgo, and they're not really documented in svgr.
|
|
33
|
+
// https://github.com/pd4d10/vite-plugin-svgr/blob/57873c10f9be1484517b90e2dfbe2e23fa62a183/README.md?plain=1#L66-L78
|
|
34
|
+
plugins: ["@svgr/plugin-svgo", "@svgr/plugin-jsx"],
|
|
35
|
+
svgo: true,
|
|
36
|
+
// Stop svgr from touching dimensions / viewBox / the svgo config.
|
|
37
|
+
dimensions: false,
|
|
38
|
+
svgoConfig: {
|
|
39
|
+
plugins: [
|
|
40
|
+
{
|
|
41
|
+
name: "preset-default",
|
|
42
|
+
params: {
|
|
43
|
+
overrides: {
|
|
44
|
+
// Don't remove viewBox if it exists in the svg.
|
|
45
|
+
removeViewBox: false
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
// Finally, remove dimensions, and more importantly, set a viewBox if
|
|
50
|
+
// it doesn't exist.
|
|
51
|
+
"removeDimensions"
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
24
55
|
}
|
|
25
56
|
};
|
|
26
57
|
var viteConfig = () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promoboxx/react-scripts-vite",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.mjs",
|
|
@@ -35,6 +35,8 @@
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
+
"@svgr/plugin-jsx": "^8.1.0",
|
|
39
|
+
"@svgr/plugin-svgo": "^8.1.0",
|
|
38
40
|
"@vitejs/plugin-react": "^4.2.1",
|
|
39
41
|
"alias-hq": "^6.2.3",
|
|
40
42
|
"eslint": "^8.55.0",
|