vite-plugin-svgr 2.2.2 → 2.3.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.
- package/dist/index.js +20 -22
- package/package.json +10 -9
package/dist/index.js
CHANGED
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
18
|
+
mod
|
|
19
|
+
));
|
|
2
20
|
const pluginutils = require("@rollup/pluginutils");
|
|
3
21
|
const fs = require("fs");
|
|
4
22
|
const vite = require("vite");
|
|
5
|
-
const _interopDefaultLegacy = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
|
|
6
|
-
function _interopNamespace(e) {
|
|
7
|
-
if (e && e.__esModule)
|
|
8
|
-
return e;
|
|
9
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
10
|
-
if (e) {
|
|
11
|
-
for (const k in e) {
|
|
12
|
-
if (k !== "default") {
|
|
13
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: () => e[k]
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
n.default = e;
|
|
22
|
-
return Object.freeze(n);
|
|
23
|
-
}
|
|
24
|
-
const fs__default = /* @__PURE__ */ _interopDefaultLegacy(fs);
|
|
25
23
|
function viteSvgr({
|
|
26
24
|
exportAsDefault,
|
|
27
25
|
svgrOptions,
|
|
@@ -34,8 +32,8 @@ function viteSvgr({
|
|
|
34
32
|
name: "vite-plugin-svgr",
|
|
35
33
|
async transform(code, id) {
|
|
36
34
|
if (filter(id)) {
|
|
37
|
-
const { transform } = await
|
|
38
|
-
const svgCode = await
|
|
35
|
+
const { transform } = await import("@svgr/core");
|
|
36
|
+
const svgCode = await fs.promises.readFile(
|
|
39
37
|
id.replace(/\?.*$/, ""),
|
|
40
38
|
"utf8"
|
|
41
39
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-svgr",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Vite plugin to transform SVGs into React components",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -29,16 +29,17 @@
|
|
|
29
29
|
"author": "Rongjian Zhang",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@types/node": "^18.
|
|
33
|
-
"tsdv": "^0.
|
|
34
|
-
"typescript": "^4.
|
|
35
|
-
"vite": "^
|
|
32
|
+
"@types/node": "^18.11.12",
|
|
33
|
+
"tsdv": "^0.8.0",
|
|
34
|
+
"typescript": "^4.9.4",
|
|
35
|
+
"vite": "^4.0.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"vite": "^2.6.0 || 3"
|
|
38
|
+
"vite": "^2.6.0 || 3 || 4"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@rollup/pluginutils": "^5.0.
|
|
42
|
-
"@svgr/core": "^6.
|
|
43
|
-
}
|
|
41
|
+
"@rollup/pluginutils": "^5.0.2",
|
|
42
|
+
"@svgr/core": "^6.5.1"
|
|
43
|
+
},
|
|
44
|
+
"packageManager": "pnpm@7.14.2"
|
|
44
45
|
}
|