fix: compile SCSS via sass instead of raw text to prevent lightningcss errors

This commit is contained in:
saberzero1 2026-02-26 16:44:51 +01:00
parent 622a423ef5
commit e7b3e00171
No known key found for this signature in database
3 changed files with 383 additions and 110 deletions

483
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -76,6 +76,7 @@
"eslint-config-prettier": "^9.1.0",
"preact": "^10.28.2",
"prettier": "^3.6.2",
"sass": "^1.97.3",
"vitest": "^2.1.9"
},
"quartz": {

View file

@ -23,12 +23,9 @@ const inlineScriptPlugin: Plugin = {
// SCSS files are loaded as raw text (CSS injected via style tags)
parentBuild.onLoad({ filter: /\.scss$/ }, async (args) => {
const fs = await import("fs");
const text = await fs.promises.readFile(args.path, "utf8");
return {
contents: text,
loader: "text",
};
const sass = await import("sass");
const result = sass.compile(args.path);
return { contents: result.css, loader: "text" };
});
// Inline TypeScript files are transpiled + bundled for the browser