Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/rollup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ function rewriteInputsNamespace(code: string) {
return code.replace(/\b__ns__\b/g, "inputs-3a86ea");
}

const INLINE_CSS = Object.fromEntries(
["svg", "png", "jpeg", "jpg", "gif", "eot", "otf", "woff", "woff2"].map((ext) => [`.${ext}`, "dataurl" as const])
);
export async function bundleStyles({path, theme}: {path?: string; theme?: string[]}): Promise<string> {
const result = await build({
bundle: true,
loader: INLINE_CSS,
...(path ? {entryPoints: [path]} : {stdin: {contents: renderTheme(theme!), loader: "css"}}),
write: false,
alias: STYLE_MODULES
Expand Down