mirror of
https://github.com/quartz-community/darkmode.git
synced 2026-07-22 02:50:22 +00:00
fix: compile SCSS via sass instead of raw text to prevent lightningcss errors
This commit is contained in:
parent
8c56820610
commit
923b97c2e6
3 changed files with 383 additions and 107 deletions
483
package-lock.json
generated
483
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -74,6 +74,7 @@
|
|||
"eslint-config-prettier": "^9.1.0",
|
||||
"preact": "^10.28.2",
|
||||
"prettier": "^3.6.2",
|
||||
"sass": "^1.97.3",
|
||||
"vitest": "^2.1.9"
|
||||
},
|
||||
"engines": {
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@ const inlineScriptPlugin: Plugin = {
|
|||
const absWorkingDir = parentBuild.initialOptions.absWorkingDir ?? process.cwd();
|
||||
|
||||
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" };
|
||||
});
|
||||
|
||||
parentBuild.onLoad({ filter: /\.inline\.ts$/ }, async (args) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue