@vesk/plugin-tailwind 0.2.16 → 0.2.18
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 +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -92,7 +92,7 @@ async function loadFallbackModule(id, base) {
|
|
|
92
92
|
const mod = await import(pkgPath);
|
|
93
93
|
return { module: mod.default ?? mod, base: path.dirname(pkgPath) };
|
|
94
94
|
}
|
|
95
|
-
const TAILWIND_BLOCK = /^\s*@(
|
|
95
|
+
const TAILWIND_BLOCK = /^\s*@theme(?:\s+(inline|static|reference))?\s*\{|^\s*@layer\s+(base|components|utilities)\s*\{|^\s*@utility\s+\w+\s*\{/m;
|
|
96
96
|
/**
|
|
97
97
|
* Scans a CSS block starting at `start` (an opening `{`) and returns the
|
|
98
98
|
* index just past its matching `}`. Quoted strings and `/* ... */`
|
|
@@ -194,7 +194,7 @@ export default function tailwindcss(options = {}) {
|
|
|
194
194
|
if (resolvedFilePath !== entryPath && !(filePath && filePath.endsWith(entry.replace(/^\.\//, '')))) {
|
|
195
195
|
return null;
|
|
196
196
|
}
|
|
197
|
-
const { directives } = extractTailwindDirectives(content);
|
|
197
|
+
const { directives, userCSS } = extractTailwindDirectives(content);
|
|
198
198
|
if (!directives)
|
|
199
199
|
return content;
|
|
200
200
|
try {
|
|
@@ -211,14 +211,14 @@ export default function tailwindcss(options = {}) {
|
|
|
211
211
|
compileOpts.loadStylesheet = (id, base) => loadFallbackStylesheet(id, base);
|
|
212
212
|
compileOpts.loadModule = (id, base) => loadFallbackModule(id, base);
|
|
213
213
|
}
|
|
214
|
-
const result = await compile(
|
|
214
|
+
const result = await compile(content, compileOpts);
|
|
215
215
|
const candidates = scanCandidates(baseDir);
|
|
216
216
|
const finalCss = result.build(candidates);
|
|
217
217
|
return finalCss;
|
|
218
218
|
}
|
|
219
219
|
catch (err) {
|
|
220
220
|
console.error(`[vesk/plugin-tailwind] Compile error:`, err instanceof Error ? err.message : String(err));
|
|
221
|
-
return content;
|
|
221
|
+
return userCSS || content;
|
|
222
222
|
}
|
|
223
223
|
},
|
|
224
224
|
async onFileWatch(filePath) {
|