@moritzloewenstein/vite-plugin-sass-glob-import 6.0.2 → 6.0.4
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 +16 -5
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +113 -151
- package/dist/index.mjs.map +1 -0
- package/package.json +13 -11
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import { Plugin } from
|
|
1
|
+
import { Plugin } from "vite";
|
|
2
2
|
|
|
3
|
+
//#region src/types.d.ts
|
|
3
4
|
interface PluginOptions {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* ignore these files for all glob imports
|
|
7
|
+
* @example ['blocks/_default/block.scss']
|
|
8
|
+
*/
|
|
9
|
+
ignorePaths?: string[];
|
|
10
|
+
/**
|
|
11
|
+
* enables autoHmr when editing a file which is imported via glob
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
autoInvalidation?: boolean;
|
|
6
15
|
}
|
|
7
|
-
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/index.d.ts
|
|
8
18
|
declare function sassGlobImports(_options?: PluginOptions): Plugin;
|
|
9
|
-
|
|
19
|
+
//#endregion
|
|
10
20
|
export { sassGlobImports as default };
|
|
21
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/index.ts"],"mappings":";;;UAAiB,aAAA;;;AAAjB;;EAKC,WAAA;EALgB;;;;EAUhB,gBAAA;AAAA;;;iBCQuB,eAAA,CAAgB,QAAA,GAAU,aAAA,GAAqB,MAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,161 +1,123 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import path from "path";
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
4
3
|
import c from "ansi-colors";
|
|
5
4
|
import { globSync } from "glob";
|
|
6
5
|
import { minimatch } from "minimatch";
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var server;
|
|
6
|
+
import { normalizePath } from "vite";
|
|
7
|
+
//#region src/index.ts
|
|
8
|
+
let IMPORT_REGEX;
|
|
9
|
+
let options;
|
|
10
|
+
let globToModuleIds;
|
|
11
|
+
let projectRoot;
|
|
12
|
+
let server;
|
|
15
13
|
function sassGlobImports(_options = {}) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
modsByFile.add(m);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
invalidateModules(server, modsByFile, Date.now());
|
|
58
|
-
await Promise.all(
|
|
59
|
-
Array.from(modsByFile).map((mod) => server.reloadModule(mod))
|
|
60
|
-
);
|
|
61
|
-
});
|
|
62
|
-
},
|
|
63
|
-
transform(src, id) {
|
|
64
|
-
return {
|
|
65
|
-
code: transform(src, id),
|
|
66
|
-
map: null
|
|
67
|
-
// provide source map if available
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
};
|
|
14
|
+
IMPORT_REGEX = /^([ \t]*(?:\/\*.*)?)@(import|use)\s+["']([^"']+\*[^"']*(?:\.scss|\.sass)?)["'];?([ \t]*(?:\/[/*].*)?)$/m;
|
|
15
|
+
options = _options;
|
|
16
|
+
globToModuleIds = /* @__PURE__ */ new Map();
|
|
17
|
+
return {
|
|
18
|
+
name: "sass-glob-import",
|
|
19
|
+
enforce: "pre",
|
|
20
|
+
configResolved(config) {
|
|
21
|
+
projectRoot = normalizePath(config.root);
|
|
22
|
+
if (options.autoInvalidation && !config.server.watch) {
|
|
23
|
+
config.logger.warn("vite-plugin-sass-glob-import: set server.watch: true for automatic glob module invalidation");
|
|
24
|
+
options.autoInvalidation = false;
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
configureServer(_server) {
|
|
28
|
+
if (!options.autoInvalidation) return;
|
|
29
|
+
server = _server;
|
|
30
|
+
server.watcher.on("all", async (_event, pathName) => {
|
|
31
|
+
if (!path.extname(pathName).match(/\.sass|\.scss/i)) return;
|
|
32
|
+
const relPathName = path.relative(projectRoot, pathName);
|
|
33
|
+
const modsToInvalidate = /* @__PURE__ */ new Set();
|
|
34
|
+
for (const [glob, modSet] of globToModuleIds) if (minimatch(relPathName, glob)) for (const mod of modSet) modsToInvalidate.add(mod);
|
|
35
|
+
const modsByFile = /* @__PURE__ */ new Set();
|
|
36
|
+
for (const mod of modsToInvalidate) {
|
|
37
|
+
const modules = server.moduleGraph.getModulesByFile(mod);
|
|
38
|
+
if (!modules) continue;
|
|
39
|
+
for (const m of modules) modsByFile.add(m);
|
|
40
|
+
}
|
|
41
|
+
invalidateModules(server, modsByFile, Date.now());
|
|
42
|
+
await Promise.all(Array.from(modsByFile).map((mod) => server.reloadModule(mod)));
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
transform(src, id) {
|
|
46
|
+
return {
|
|
47
|
+
code: transform(src, id),
|
|
48
|
+
map: null
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
};
|
|
71
52
|
}
|
|
72
|
-
function invalidateModules(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
return modules;
|
|
53
|
+
function invalidateModules(server, modules, timestamp) {
|
|
54
|
+
const seen = /* @__PURE__ */ new Set();
|
|
55
|
+
for (const mod of modules) server.moduleGraph.invalidateModule(mod, seen, timestamp, true);
|
|
56
|
+
return modules;
|
|
78
57
|
}
|
|
79
58
|
function isSassOrScss(filename) {
|
|
80
|
-
|
|
59
|
+
return !fs.statSync(filename).isDirectory() && path.extname(filename).match(/\.sass|\.scss/i);
|
|
81
60
|
}
|
|
82
61
|
function transform(src, id) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
const scssFilename = path.relative(basePath, anyFilename).replace(/\\/g, "/").replace(/^\//, "");
|
|
141
|
-
if (!ignorePaths.some((ignorePath) => {
|
|
142
|
-
return minimatch(scssFilename, ignorePath);
|
|
143
|
-
})) {
|
|
144
|
-
const file = isGlobTrailStatic ? `"${scssFilename}" as ${path.parse(scssFilename).name}_${index}` : `"${scssFilename}"`;
|
|
145
|
-
imports.push(`@${importType} ${file}${isSass ? "" : ";"}`);
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
if (startComment) {
|
|
149
|
-
imports.unshift(startComment);
|
|
150
|
-
}
|
|
151
|
-
if (endComment) {
|
|
152
|
-
imports.push(endComment);
|
|
153
|
-
}
|
|
154
|
-
const replaceString = imports.join("\n");
|
|
155
|
-
src = src.replace(importRule, replaceString);
|
|
156
|
-
}
|
|
157
|
-
return src;
|
|
62
|
+
const fileName = path.basename(id);
|
|
63
|
+
const filePath = path.dirname(id);
|
|
64
|
+
const isSass = path.extname(fileName).match(/\.sass/i);
|
|
65
|
+
const searchBases = [filePath];
|
|
66
|
+
const ignorePaths = options.ignorePaths || [];
|
|
67
|
+
const contentLinesCount = src.split("\n").length;
|
|
68
|
+
for (let i = 0; i < contentLinesCount; i++) {
|
|
69
|
+
const result = src.match(IMPORT_REGEX);
|
|
70
|
+
if (!result) continue;
|
|
71
|
+
const [importRule, startComment, importType, globPattern, endComment] = result;
|
|
72
|
+
if (!globPattern) continue;
|
|
73
|
+
if (options.autoInvalidation && server?.watcher) {
|
|
74
|
+
const projectGlob = path.relative(projectRoot, path.resolve(path.join(filePath, globPattern)));
|
|
75
|
+
const hasGlob = globToModuleIds.has(projectGlob);
|
|
76
|
+
if (!globToModuleIds.get(projectGlob)?.has(id)) {
|
|
77
|
+
const modSet = globToModuleIds.get(projectGlob) ?? /* @__PURE__ */ new Set();
|
|
78
|
+
modSet.add(id);
|
|
79
|
+
globToModuleIds.set(projectGlob, modSet);
|
|
80
|
+
if (!hasGlob) {
|
|
81
|
+
const globDir = projectGlob.split("*")[0];
|
|
82
|
+
if (globDir) server.watcher.add(globDir);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
let files = [];
|
|
87
|
+
let basePath = "";
|
|
88
|
+
for (const searchBase of searchBases) {
|
|
89
|
+
basePath = searchBase;
|
|
90
|
+
files = globSync(path.join(searchBase, globPattern), {
|
|
91
|
+
cwd: "./",
|
|
92
|
+
windowsPathsNoEscape: true
|
|
93
|
+
}).sort((a, b) => a.localeCompare(b, "en"));
|
|
94
|
+
const globPatternWithoutWildcard = globPattern.split("*")[0];
|
|
95
|
+
if (globPatternWithoutWildcard) {
|
|
96
|
+
if (!fs.existsSync(path.join(searchBase, globPatternWithoutWildcard))) console.warn(c.yellow(`Sass Glob Import: Directories don't exist for the glob pattern "${globPattern}"`));
|
|
97
|
+
}
|
|
98
|
+
if (files.length > 0) break;
|
|
99
|
+
}
|
|
100
|
+
const isGlobTrailStatic = !globPattern.split("/").at(-1)?.includes("*");
|
|
101
|
+
const imports = [];
|
|
102
|
+
files.forEach((anyFilename, index) => {
|
|
103
|
+
if (!isSassOrScss(anyFilename)) return;
|
|
104
|
+
const scssFilename = path.relative(basePath, anyFilename).replace(/\\/g, "/").replace(/^\//, "");
|
|
105
|
+
const rootRelFilename = path.relative(projectRoot, anyFilename);
|
|
106
|
+
if (!ignorePaths.some((ignorePath) => {
|
|
107
|
+
return minimatch(rootRelFilename, ignorePath);
|
|
108
|
+
})) {
|
|
109
|
+
const file = isGlobTrailStatic ? `"${scssFilename}" as ${path.parse(scssFilename).name}_${index}` : `"${scssFilename}"`;
|
|
110
|
+
imports.push(`@${importType} ${file}${isSass ? "" : ";"}`);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
if (startComment) imports.unshift(startComment);
|
|
114
|
+
if (endComment) imports.push(endComment);
|
|
115
|
+
const replaceString = imports.join("\n");
|
|
116
|
+
src = src.replace(importRule, replaceString);
|
|
117
|
+
}
|
|
118
|
+
return src;
|
|
158
119
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
120
|
+
//#endregion
|
|
121
|
+
export { sassGlobImports as default };
|
|
122
|
+
|
|
123
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport c from \"ansi-colors\";\nimport { globSync } from \"glob\";\nimport { minimatch } from \"minimatch\";\nimport {\n\ttype ModuleNode,\n\tnormalizePath,\n\ttype Plugin,\n\ttype ViteDevServer,\n} from \"vite\";\nimport type { PluginOptions, TransformResult } from \"./types.ts\";\n\nlet IMPORT_REGEX: RegExp;\nlet options: PluginOptions;\nlet globToModuleIds: Map<string, Set<string>>;\nlet projectRoot: string;\nlet server: ViteDevServer;\nexport default function sassGlobImports(_options: PluginOptions = {}): Plugin {\n\tIMPORT_REGEX =\n\t\t/^([ \\t]*(?:\\/\\*.*)?)@(import|use)\\s+[\"']([^\"']+\\*[^\"']*(?:\\.scss|\\.sass)?)[\"'];?([ \\t]*(?:\\/[/*].*)?)$/m;\n\toptions = _options;\n\tglobToModuleIds = new Map();\n\treturn {\n\t\tname: \"sass-glob-import\",\n\t\tenforce: \"pre\",\n\t\tconfigResolved(config) {\n\t\t\tprojectRoot = normalizePath(config.root);\n\t\t\tif (options.autoInvalidation && !config.server.watch) {\n\t\t\t\tconfig.logger.warn(\n\t\t\t\t\t\"vite-plugin-sass-glob-import: set server.watch: true for automatic glob module invalidation\",\n\t\t\t\t);\n\t\t\t\toptions.autoInvalidation = false;\n\t\t\t}\n\t\t},\n\t\tconfigureServer(_server) {\n\t\t\tif (!options.autoInvalidation) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tserver = _server;\n\t\t\tserver.watcher.on(\"all\", async (_event, pathName) => {\n\t\t\t\tif (!path.extname(pathName).match(/\\.sass|\\.scss/i)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst relPathName = path.relative(projectRoot, pathName);\n\t\t\t\tconst modsToInvalidate = new Set<string>();\n\t\t\t\tfor (const [glob, modSet] of globToModuleIds) {\n\t\t\t\t\tif (minimatch(relPathName, glob)) {\n\t\t\t\t\t\tfor (const mod of modSet) {\n\t\t\t\t\t\t\tmodsToInvalidate.add(mod);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst modsByFile = new Set<ModuleNode>();\n\t\t\t\tfor (const mod of modsToInvalidate) {\n\t\t\t\t\tconst modules = server.moduleGraph.getModulesByFile(mod);\n\t\t\t\t\tif (!modules) continue;\n\t\t\t\t\tfor (const m of modules) {\n\t\t\t\t\t\tmodsByFile.add(m);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tinvalidateModules(server, modsByFile, Date.now());\n\t\t\t\tawait Promise.all(\n\t\t\t\t\tArray.from(modsByFile).map((mod) => server.reloadModule(mod)),\n\t\t\t\t);\n\t\t\t});\n\t\t},\n\t\ttransform(src: string, id: string): TransformResult {\n\t\t\treturn {\n\t\t\t\tcode: transform(src, id),\n\t\t\t\tmap: null, // provide source map if available\n\t\t\t};\n\t\t},\n\t};\n}\n\nfunction invalidateModules(\n\tserver: ViteDevServer,\n\tmodules: Set<ModuleNode>,\n\ttimestamp: number,\n): Set<ModuleNode> {\n\tconst seen = new Set<ModuleNode>();\n\tfor (const mod of modules) {\n\t\tserver.moduleGraph.invalidateModule(mod, seen, timestamp, true);\n\t}\n\treturn modules;\n}\n\nfunction isSassOrScss(filename: string) {\n\treturn (\n\t\t!fs.statSync(filename).isDirectory() &&\n\t\tpath.extname(filename).match(/\\.sass|\\.scss/i)\n\t);\n}\n\nfunction transform(src: string, id: string): string {\n\tconst fileName = path.basename(id);\n\tconst filePath = path.dirname(id);\n\t// Determine if this is Sass (vs SCSS) based on file extension\n\tconst isSass = path.extname(fileName).match(/\\.sass/i);\n\n\t// Store base locations\n\tconst searchBases = [filePath];\n\tconst ignorePaths = options.ignorePaths || [];\n\tconst contentLinesCount = src.split(\"\\n\").length;\n\n\tfor (let i = 0; i < contentLinesCount; i++) {\n\t\tconst result = src.match(IMPORT_REGEX);\n\t\tif (!result) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst [importRule, startComment, importType, globPattern, endComment] =\n\t\t\tresult;\n\n\t\tif (!globPattern) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (options.autoInvalidation && server?.watcher) {\n\t\t\tconst projectGlob = path.relative(\n\t\t\t\tprojectRoot,\n\t\t\t\tpath.resolve(path.join(filePath, globPattern)),\n\t\t\t);\n\t\t\tconst hasGlob = globToModuleIds.has(projectGlob);\n\t\t\tif (!globToModuleIds.get(projectGlob)?.has(id)) {\n\t\t\t\tconst modSet = globToModuleIds.get(projectGlob) ?? new Set();\n\t\t\t\tmodSet.add(id);\n\t\t\t\tglobToModuleIds.set(projectGlob, modSet);\n\t\t\t\tif (!hasGlob) {\n\t\t\t\t\tconst globDir = projectGlob.split(\"*\")[0];\n\t\t\t\t\tif (globDir) {\n\t\t\t\t\t\tserver.watcher.add(globDir);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet files: string[] = [];\n\t\tlet basePath = \"\";\n\t\tfor (const searchBase of searchBases) {\n\t\t\tbasePath = searchBase;\n\t\t\tfiles = globSync(path.join(searchBase, globPattern), {\n\t\t\t\tcwd: \"./\",\n\t\t\t\twindowsPathsNoEscape: true,\n\t\t\t}).sort((a, b) => a.localeCompare(b, \"en\"));\n\n\t\t\t// Do directories exist matching the glob pattern?\n\t\t\tconst globPatternWithoutWildcard = globPattern.split(\"*\")[0];\n\t\t\tif (globPatternWithoutWildcard) {\n\t\t\t\tconst directoryExists = fs.existsSync(\n\t\t\t\t\tpath.join(searchBase, globPatternWithoutWildcard),\n\t\t\t\t);\n\t\t\t\tif (!directoryExists) {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\tc.yellow(\n\t\t\t\t\t\t\t`Sass Glob Import: Directories don't exist for the glob pattern \"${globPattern}\"`,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (files.length > 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tconst isGlobTrailStatic = !globPattern.split(\"/\").at(-1)?.includes(\"*\");\n\t\tconst imports = [];\n\t\tfiles.forEach((anyFilename: string, index: number) => {\n\t\t\tif (!isSassOrScss(anyFilename)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst scssFilename = path\n\t\t\t\t// Remove parent base path\n\t\t\t\t.relative(basePath, anyFilename)\n\t\t\t\t.replace(/\\\\/g, \"/\")\n\t\t\t\t// Remove leading slash\n\t\t\t\t.replace(/^\\//, \"\");\n\t\t\tconst rootRelFilename = path.relative(projectRoot, anyFilename);\n\t\t\tif (\n\t\t\t\t!ignorePaths.some((ignorePath: string) => {\n\t\t\t\t\treturn minimatch(rootRelFilename, ignorePath);\n\t\t\t\t})\n\t\t\t) {\n\t\t\t\tconst file = isGlobTrailStatic\n\t\t\t\t\t? `\"${scssFilename}\" as ${path.parse(scssFilename).name}_${index}`\n\t\t\t\t\t: `\"${scssFilename}\"`;\n\t\t\t\timports.push(`@${importType} ${file}${isSass ? \"\" : \";\"}`);\n\t\t\t}\n\t\t});\n\n\t\tif (startComment) {\n\t\t\timports.unshift(startComment);\n\t\t}\n\n\t\tif (endComment) {\n\t\t\timports.push(endComment);\n\t\t}\n\n\t\tconst replaceString = imports.join(\"\\n\");\n\t\t// biome-ignore lint: easier for now\n\t\tsrc = src.replace(importRule, replaceString);\n\t}\n\n\t// Return the transformed source\n\treturn src;\n}\n"],"mappings":";;;;;;;AAaA,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,SAAwB,gBAAgB,WAA0B,EAAE,EAAU;AAC7E,gBACC;AACD,WAAU;AACV,mCAAkB,IAAI,KAAK;AAC3B,QAAO;EACN,MAAM;EACN,SAAS;EACT,eAAe,QAAQ;AACtB,iBAAc,cAAc,OAAO,KAAK;AACxC,OAAI,QAAQ,oBAAoB,CAAC,OAAO,OAAO,OAAO;AACrD,WAAO,OAAO,KACb,8FACA;AACD,YAAQ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IAAI,CAAC,GAAG,GAAG,EAAE,SAAS,IAAI;EACvE,MAAM,UAAU,EAAE;AAClB,QAAM,SAAS,aAAqB,UAAkB;AACrD,OAAI,CAAC,aAAa,YAAY,CAC7B;GAGD,MAAM,eAAe,KAEnB,SAAS,UAAU,YAAY,CAC/B,QAAQ,OAAO,IAAI,CAEnB,QAAQ,OAAO,GAAG;GACpB,MAAM,kBAAkB,KAAK,SAAS,aAAa,YAAY;AAC/D,OACC,CAAC,YAAY,MAAM,eAAuB;AACzC,WAAO,UAAU,iBAAiB,WAAW;KAC5C,EACD;IACD,MAAM,OAAO,oBACV,IAAI,aAAa,OAAO,KAAK,MAAM,aAAa,CAAC,KAAK,GAAG,UACzD,IAAI,aAAa;AACpB,YAAQ,KAAK,IAAI,WAAW,GAAG,OAAO,SAAS,KAAK,MAAM;;IAE1D;AAEF,MAAI,aACH,SAAQ,QAAQ,aAAa;AAG9B,MAAI,WACH,SAAQ,KAAK,WAAW;EAGzB,MAAM,gBAAgB,QAAQ,KAAK,KAAK;AAExC,QAAM,IAAI,QAAQ,YAAY,cAAc;;AAI7C,QAAO"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moritzloewenstein/vite-plugin-sass-glob-import",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "6.0.4",
|
|
4
5
|
"description": "Use glob syntax for imports in your main Sass or SCSS file.",
|
|
5
6
|
"main": "./dist/index.mjs",
|
|
6
7
|
"types": "./dist/index.d.mts",
|
|
@@ -8,8 +9,9 @@
|
|
|
8
9
|
"dist"
|
|
9
10
|
],
|
|
10
11
|
"scripts": {
|
|
11
|
-
"
|
|
12
|
-
"
|
|
12
|
+
"build": "tsdown",
|
|
13
|
+
"dev": "tsdown --watch",
|
|
14
|
+
"typecheck": "tsc --noEmit",
|
|
13
15
|
"test": "vitest run",
|
|
14
16
|
"biome:check": "biome check .",
|
|
15
17
|
"biome:write": "biome check . --write",
|
|
@@ -32,20 +34,20 @@
|
|
|
32
34
|
"license": "MIT",
|
|
33
35
|
"dependencies": {
|
|
34
36
|
"ansi-colors": "^4.1.3",
|
|
35
|
-
"glob": "^
|
|
36
|
-
"minimatch": "^10.
|
|
37
|
+
"glob": "^13.0.6",
|
|
38
|
+
"minimatch": "^10.2.4"
|
|
37
39
|
},
|
|
38
40
|
"peerDependencies": {
|
|
39
41
|
"vite": "^6.0.0 || ^7.0.0"
|
|
40
42
|
},
|
|
41
43
|
"devDependencies": {
|
|
42
|
-
"@biomejs/biome": "^2.
|
|
44
|
+
"@biomejs/biome": "^2.4.7",
|
|
43
45
|
"@types/glob": "^8.1.0",
|
|
44
|
-
"@types/node": "^22.
|
|
45
|
-
"
|
|
46
|
-
"typescript": "^5.9.
|
|
47
|
-
"vite": "^7.1
|
|
48
|
-
"vitest": "^
|
|
46
|
+
"@types/node": "^22.19.15",
|
|
47
|
+
"tsdown": "^0.21.2",
|
|
48
|
+
"typescript": "^5.9.3",
|
|
49
|
+
"vite": "^7.3.1",
|
|
50
|
+
"vitest": "^4.1.0"
|
|
49
51
|
},
|
|
50
52
|
"volta": {
|
|
51
53
|
"node": "22.19.0"
|