mirror of
https://github.com/quartz-community/spacer.git
synced 2026-07-22 02:50:25 +00:00
fix: compile SCSS via sass instead of raw text to prevent lightningcss errors
This commit is contained in:
parent
622a423ef5
commit
e7b3e00171
3 changed files with 383 additions and 110 deletions
483
package-lock.json
generated
483
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -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": {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue