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,18 +1,19 @@
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, {})
.set('filename', 'styles.css')
.set('compress', true)
.include('src/assets/css/'))
.render();
const generatedCss = await (stylus(cssStr, {})
.set('filename', 'styles.css')
.set('compress', true)
.include('src/assets/css/'))
.render();
export const renderStylus = () => {
return generatedCss;
};
export const compressCss = async (css: string) => {
return await (stylus(css, {}).set('compress', true)).render();
return await (stylus(css, {}).set('compress', true)).render();
};