@promoboxx/react-scripts-vite 0.2.2 → 0.2.4

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.
@@ -46,7 +46,7 @@ var import_replaceEnvInHtml = __toESM(require("./replaceEnvInHtml"));
46
46
  var pluginOptions = {
47
47
  checker: {
48
48
  eslint: process.env.DISABLE_ESLINT_PLUGIN === "true" ? void 0 : {
49
- lintCommand: `eslint --max-warnings=${process.env.CI === "true" ? 0 : -1} "./src/**/*.{ts,tsx,js,jsx,mjs,cjs}"`
49
+ lintCommand: `eslint --cache --max-warnings=${process.env.CI === "true" ? 0 : -1} "./src/**/*.{ts,tsx,js,jsx,mjs,cjs}"`
50
50
  },
51
51
  typescript: process.env.TSC_COMPILE_ON_ERROR !== "true",
52
52
  enableBuild: true,
@@ -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 = () => {
@@ -11,7 +11,7 @@ import replaceEnvInHtml from "./replaceEnvInHtml.mjs";
11
11
  var pluginOptions = {
12
12
  checker: {
13
13
  eslint: process.env.DISABLE_ESLINT_PLUGIN === "true" ? void 0 : {
14
- lintCommand: `eslint --max-warnings=${process.env.CI === "true" ? 0 : -1} "./src/**/*.{ts,tsx,js,jsx,mjs,cjs}"`
14
+ lintCommand: `eslint --cache --max-warnings=${process.env.CI === "true" ? 0 : -1} "./src/**/*.{ts,tsx,js,jsx,mjs,cjs}"`
15
15
  },
16
16
  typescript: process.env.TSC_COMPILE_ON_ERROR !== "true",
17
17
  enableBuild: true,
@@ -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.2",
3
+ "version": "0.2.4",
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",