vite-plugin-svg-spritegen 1.2.4 → 1.2.6
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 +2 -1
- package/dist/index.mjs +2 -1
- package/package.json +1 -1
- package/dist/build-svg-map.d.ts +0 -2
- package/dist/index.d.ts +0 -3
- package/dist/types.d.ts +0 -33
- package/dist/write-gitignore.d.ts +0 -1
- package/dist/write-if-changed.d.ts +0 -1
- package/dist/write-sprite.d.ts +0 -2
- package/dist/write-types.d.ts +0 -2
package/dist/index.js
CHANGED
|
@@ -83,7 +83,8 @@ const writeGitignore = async (filePath, spriteName, typesName) => {
|
|
|
83
83
|
const writeSprite = (spritePath, svgMap) => {
|
|
84
84
|
const symbols = [];
|
|
85
85
|
const definitions = [];
|
|
86
|
-
|
|
86
|
+
const svgSorted = [...svgMap].sort((a, b) => String(a[0]).localeCompare(b[0])).map(([_, svg]) => svg);
|
|
87
|
+
for (const svg of svgSorted) {
|
|
87
88
|
if (spritePath === svg.filePath) continue;
|
|
88
89
|
let content2 = svg.content;
|
|
89
90
|
if (svg.svgo !== false) {
|
package/dist/index.mjs
CHANGED
|
@@ -81,7 +81,8 @@ const writeGitignore = async (filePath, spriteName, typesName) => {
|
|
|
81
81
|
const writeSprite = (spritePath, svgMap) => {
|
|
82
82
|
const symbols = [];
|
|
83
83
|
const definitions = [];
|
|
84
|
-
|
|
84
|
+
const svgSorted = [...svgMap].sort((a, b) => String(a[0]).localeCompare(b[0])).map(([_, svg]) => svg);
|
|
85
|
+
for (const svg of svgSorted) {
|
|
85
86
|
if (spritePath === svg.filePath) continue;
|
|
86
87
|
let content2 = svg.content;
|
|
87
88
|
if (svg.svgo !== false) {
|
package/package.json
CHANGED
package/dist/build-svg-map.d.ts
DELETED
package/dist/index.d.ts
DELETED
package/dist/types.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { FilterPattern } from 'vite';
|
|
2
|
-
import { Config as SvgoConfig } from 'svgo';
|
|
3
|
-
export interface InputConfig {
|
|
4
|
-
pattern?: string;
|
|
5
|
-
baseDir?: string;
|
|
6
|
-
prefix?: string;
|
|
7
|
-
getSymbolId?: (config: Omit<ResolvedInputConfig, 'symbolId'>) => string;
|
|
8
|
-
removeAttrs?: string[];
|
|
9
|
-
svgoPlugins?: SvgoConfig['plugins'];
|
|
10
|
-
svgo?: SvgoConfig | false;
|
|
11
|
-
}
|
|
12
|
-
export interface ResolvedInputConfig extends Required<InputConfig> {
|
|
13
|
-
symbolId: string;
|
|
14
|
-
matchPath: string;
|
|
15
|
-
filePath: string;
|
|
16
|
-
content: string;
|
|
17
|
-
}
|
|
18
|
-
export type SvgMap = Map<string, ResolvedInputConfig>;
|
|
19
|
-
export interface StripUnusedConfig {
|
|
20
|
-
enabled?: boolean;
|
|
21
|
-
srcInclude?: FilterPattern;
|
|
22
|
-
srcExclude?: FilterPattern;
|
|
23
|
-
whitelist?: string[];
|
|
24
|
-
}
|
|
25
|
-
export interface PluginConfig {
|
|
26
|
-
outputDir: string;
|
|
27
|
-
input?: InputConfig | InputConfig[];
|
|
28
|
-
stripUnused?: boolean | StripUnusedConfig;
|
|
29
|
-
typesFileName?: string;
|
|
30
|
-
spriteFileName?: string;
|
|
31
|
-
gitignore?: boolean;
|
|
32
|
-
matchPattern?: string | RegExp;
|
|
33
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const writeGitignore: (filePath: string, spriteName: string, typesName: string) => Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const writeIfChanged: (filePath: string, content?: string) => boolean;
|
package/dist/write-sprite.d.ts
DELETED
package/dist/write-types.d.ts
DELETED