vite-plugin-svg-spritegen 2.0.1 → 2.0.2

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 CHANGED
@@ -228,7 +228,10 @@ function svgSpritegen(config) {
228
228
  allSvgs = await buildSvgMap(inputConfigsResolved);
229
229
  await writeTypes(typesFilePath, allSvgs);
230
230
  if (config.gitignore !== false) await writeGitignore(gitignoreFilePath, "sprite.svg", "types.ts");
231
- if (isBuild) return;
231
+ if (isBuild) {
232
+ writeIfChanged(spriteFilePath);
233
+ return;
234
+ }
232
235
  writeSprite(spriteFilePath, allSvgs);
233
236
  const onWatch = (changedPath) => {
234
237
  if (changedPath === spriteFilePath) return;
package/dist/index.mjs CHANGED
@@ -200,7 +200,10 @@ function svgSpritegen(config) {
200
200
  allSvgs = await buildSvgMap(inputConfigsResolved);
201
201
  await writeTypes(typesFilePath, allSvgs);
202
202
  if (config.gitignore !== false) await writeGitignore(gitignoreFilePath, "sprite.svg", "types.ts");
203
- if (isBuild) return;
203
+ if (isBuild) {
204
+ writeIfChanged(spriteFilePath);
205
+ return;
206
+ }
204
207
  writeSprite(spriteFilePath, allSvgs);
205
208
  const onWatch = (changedPath) => {
206
209
  if (changedPath === spriteFilePath) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-svg-spritegen",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Vite plugin that generates an svg spritesheet, optionally removing unused svg files.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",