Fix macros/build.renderStylus() not loading CSS each build

This commit is contained in:
redphx 2024-07-31 07:39:39 +07:00
parent 0d3385790c
commit 09a2c86ad4

View File

@ -1,6 +1,8 @@
import stylus from 'stylus'; import stylus from 'stylus';
import cssStr from "@assets/css/styles.styl" with { type: "text" }; export const renderStylus = async () => {
const file = Bun.file('./src/assets/css/styles.styl');
const cssStr = await file.text();
const generatedCss = await (stylus(cssStr, {}) const generatedCss = await (stylus(cssStr, {})
.set('filename', 'styles.css') .set('filename', 'styles.css')
@ -8,7 +10,6 @@ const generatedCss = await (stylus(cssStr, {})
.include('src/assets/css/')) .include('src/assets/css/'))
.render(); .render();
export const renderStylus = () => {
return generatedCss; return generatedCss;
}; };