mirror of
https://github.com/quartz-community/content-page.git
synced 2026-07-22 02:50:24 +00:00
fix: compile SCSS via sass instead of raw text to prevent lightningcss errors
This commit is contained in:
parent
7d9a7549e4
commit
ee899ff796
3 changed files with 382 additions and 106 deletions
478
package-lock.json
generated
478
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -79,6 +79,7 @@
|
|||
"eslint-config-prettier": "^9.1.0",
|
||||
"preact": "^10.28.2",
|
||||
"prettier": "^3.6.2",
|
||||
"sass": "^1.97.3",
|
||||
"vitest": "^2.1.9"
|
||||
},
|
||||
"engines": {
|
||||
|
|
|
|||
|
|
@ -23,12 +23,9 @@ export default defineConfig({
|
|||
name: "text-loader",
|
||||
setup(build) {
|
||||
build.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" };
|
||||
});
|
||||
|
||||
build.onLoad({ filter: /\.inline\.ts$/ }, async (args) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue