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.
- package/dist/index.js +6 -9
- 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
|
|
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
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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