vite-plugin-css-svg-mask-image 1.0.4 → 1.0.5

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 +6 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -80,11 +80,7 @@ export function svgMaskPlugin(options = {}) {
80
80
  if (!idPath.match(/\.(css|scss|sass)$/)) {
81
81
  return null;
82
82
  }
83
- const syntax = /\.(scss|sass)$/.test(idPath) ? postcssScss : undefined;
84
- const ast = postcss.parse(code, {
85
- from: id,
86
- ...(syntax && { parser: syntax }),
87
- });
83
+ const ast = postcssScss.parse(code, { from: id });
88
84
  let has_svg_functions = false;
89
85
  ast.walkDecls("mask-image", (decl) => {
90
86
  const value = decl.value.trim();
@@ -131,10 +127,11 @@ export function svgMaskPlugin(options = {}) {
131
127
  if (!has_svg_functions) {
132
128
  return null;
133
129
  }
134
- const processOpts = { from: id, to: id };
135
- if (syntax)
136
- processOpts.stringifier = postcssScss;
137
- const result = await postcss().process(ast, processOpts);
130
+ const result = await postcss().process(ast, {
131
+ from: id,
132
+ to: id,
133
+ stringifier: postcssScss,
134
+ });
138
135
  processed_files.add(id);
139
136
  return {
140
137
  code: result.css,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-css-svg-mask-image",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Vite plugin to transform CSS/SCSS files with svg() mask-image function calls to CSS variables",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",