From 36db8db1e7d94a9d377c63bbca15299e913f8233 Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Sat, 22 Jun 2024 16:29:54 +0700 Subject: [PATCH] Minify syntax in dist file --- build.ts | 3 +++ src/utils/css.ts | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build.ts b/build.ts index 2a5077d..34373c0 100644 --- a/build.ts +++ b/build.ts @@ -45,6 +45,9 @@ const build = async (target: BuildTarget, version: string, config: any={}) => { entrypoints: ['src/index.ts'], outdir: outDir, naming: outputScriptName, + minify: { + syntax: true, + }, define: { 'Bun.env.BUILD_TARGET': JSON.stringify(target), 'Bun.env.SCRIPT_VERSION': JSON.stringify(version), diff --git a/src/utils/css.ts b/src/utils/css.ts index d2e9903..732cecb 100644 --- a/src/utils/css.ts +++ b/src/utils/css.ts @@ -4,7 +4,8 @@ import { renderStylus } from "@macros/build" with {type: "macro"}; export function addCss() { - let css = renderStylus(); + const STYLUS_CSS = renderStylus(); + let css = STYLUS_CSS; if (getPref(PrefKey.BLOCK_SOCIAL_FEATURES)) { css += `