vite-plugin-svg-sprite 0.5.1 → 0.5.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/cjs/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export interface SvgSpriteOptions {
5
5
  include?: string[] | string;
6
6
  symbolId?: string;
7
7
  svgo?: boolean | SvgoOptimizeOptions;
8
+ moduleSideEffects?: boolean;
8
9
  }
9
10
  declare const _default: (options?: SvgSpriteOptions) => Plugin<any>;
10
11
  export default _default;
package/cjs/index.js CHANGED
@@ -19,7 +19,7 @@ exports.default = (options) => {
19
19
  const plugin = {
20
20
  name: 'svg-sprite',
21
21
  async transform(src, filepath) {
22
- var _a, _b;
22
+ var _a, _b, _c;
23
23
  if (!micromatch_1.default.isMatch(filepath, match, {
24
24
  dot: true,
25
25
  })) {
@@ -59,6 +59,7 @@ exports.default = (options) => {
59
59
  `;
60
60
  return {
61
61
  code: codeToReturn,
62
+ moduleSideEffects: (_c = options === null || options === void 0 ? void 0 : options.moduleSideEffects) !== null && _c !== void 0 ? _c : true,
62
63
  map: { mappings: '' },
63
64
  };
64
65
  },
package/esm/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export interface SvgSpriteOptions {
5
5
  include?: string[] | string;
6
6
  symbolId?: string;
7
7
  svgo?: boolean | SvgoOptimizeOptions;
8
+ moduleSideEffects?: boolean;
8
9
  }
9
10
  declare const _default: (options?: SvgSpriteOptions) => Plugin<any>;
10
11
  export default _default;
package/esm/index.js CHANGED
@@ -14,7 +14,7 @@ export default (options) => {
14
14
  const plugin = {
15
15
  name: 'svg-sprite',
16
16
  async transform(src, filepath) {
17
- var _a, _b;
17
+ var _a, _b, _c;
18
18
  if (!micromatch.isMatch(filepath, match, {
19
19
  dot: true,
20
20
  })) {
@@ -54,6 +54,7 @@ export default (options) => {
54
54
  `;
55
55
  return {
56
56
  code: codeToReturn,
57
+ moduleSideEffects: (_c = options === null || options === void 0 ? void 0 : options.moduleSideEffects) !== null && _c !== void 0 ? _c : true,
57
58
  map: { mappings: '' },
58
59
  };
59
60
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-svg-sprite",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "SVG sprite plugin for Vite",
5
5
  "type": "module",
6
6
  "exports": {
@@ -59,13 +59,13 @@
59
59
  "@types/svgo": "^3.0.0",
60
60
  "@types/svg-parser": "^2.0.3",
61
61
 
62
- "@typescript-eslint/eslint-plugin": "^6.0.0",
62
+ "@typescript-eslint/eslint-plugin": "^7.7.1",
63
63
  "eslint": "^8.45.0",
64
64
  "eslint-config-airbnb-base": "^15.0.0",
65
- "eslint-config-airbnb-typescript": "^17.1.0",
65
+ "eslint-config-airbnb-typescript": "^18.0.0",
66
66
  "eslint-plugin-import": "^2.22.1",
67
67
  "typescript": "^5.1.6",
68
- "vite": "^4.0.0"
68
+ "vite": "^5.0.0"
69
69
  },
70
70
  "dependencies": {
71
71
  "micromatch": "^4.0.2",
package/src/index.ts CHANGED
@@ -14,6 +14,7 @@ export interface SvgSpriteOptions {
14
14
  include?: string[] | string;
15
15
  symbolId?: string;
16
16
  svgo?: boolean | SvgoOptimizeOptions;
17
+ moduleSideEffects?: boolean;
17
18
  }
18
19
 
19
20
  export default (options?: SvgSpriteOptions) => {
@@ -74,6 +75,7 @@ export default (options?: SvgSpriteOptions) => {
74
75
 
75
76
  return {
76
77
  code: codeToReturn,
78
+ moduleSideEffects: options?.moduleSideEffects ?? true,
77
79
  map: { mappings: '' },
78
80
  };
79
81
  },