vite-plugin-svgr 3.0.0 → 3.1.0

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -0
  2. package/package.json +3 -2
package/dist/index.js CHANGED
@@ -8,11 +8,13 @@ export default function viteSvgr({ exportAsDefault, svgrOptions, esbuildOptions,
8
8
  async transform(code, id) {
9
9
  if (filter(id)) {
10
10
  const { transform } = await import("@svgr/core");
11
+ const { default: jsx } = await import("@svgr/plugin-jsx");
11
12
  const svgCode = await fs.promises.readFile(id.replace(/\?.*$/, ""), "utf8");
12
13
  const componentCode = await transform(svgCode, svgrOptions, {
13
14
  filePath: id,
14
15
  caller: {
15
16
  previousExport: exportAsDefault ? null : code,
17
+ defaultPlugins: [jsx],
16
18
  },
17
19
  });
18
20
  const res = await transformWithEsbuild(componentCode, id, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-svgr",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "Vite plugin to transform SVGs into React components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -40,7 +40,8 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@rollup/pluginutils": "^5.0.2",
43
- "@svgr/core": "^7.0.0"
43
+ "@svgr/core": "^7.0.0",
44
+ "@svgr/plugin-jsx": "^7.0.0"
44
45
  },
45
46
  "packageManager": "pnpm@8.4.0"
46
47
  }