@moritzloewenstein/vite-plugin-sass-glob-import 6.0.2 → 6.0.3
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.d.mts +8 -0
- package/dist/index.mjs +2 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { Plugin } from 'vite';
|
|
2
2
|
|
|
3
3
|
interface PluginOptions {
|
|
4
|
+
/**
|
|
5
|
+
* ignore these files for all glob imports
|
|
6
|
+
* @example ['blocks/_default/block.scss']
|
|
7
|
+
*/
|
|
4
8
|
ignorePaths?: string[];
|
|
9
|
+
/**
|
|
10
|
+
* enables autoHmr when editing a file which is imported via glob
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
5
13
|
autoInvalidation?: boolean;
|
|
6
14
|
}
|
|
7
15
|
|
package/dist/index.mjs
CHANGED
|
@@ -138,8 +138,9 @@ function transform(src, id) {
|
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
140
140
|
const scssFilename = path.relative(basePath, anyFilename).replace(/\\/g, "/").replace(/^\//, "");
|
|
141
|
+
const rootRelFilename = path.relative(projectRoot, anyFilename);
|
|
141
142
|
if (!ignorePaths.some((ignorePath) => {
|
|
142
|
-
return minimatch(
|
|
143
|
+
return minimatch(rootRelFilename, ignorePath);
|
|
143
144
|
})) {
|
|
144
145
|
const file = isGlobTrailStatic ? `"${scssFilename}" as ${path.parse(scssFilename).name}_${index}` : `"${scssFilename}"`;
|
|
145
146
|
imports.push(`@${importType} ${file}${isSass ? "" : ";"}`);
|
package/package.json
CHANGED