From 2e203627c5d8fd79280562111c68ed0bb0588b1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=88=98=ED=98=84?= Date: Mon, 9 Nov 2026 19:35:35 +0900 Subject: [PATCH] fix(storybook): type the font path plugin as a Vite Plugin this.warn() in the hm-ui-theme-font-path transform failed tsc -b with TS2339 because the untyped object literal made `this` the literal itself. Annotate it as Vite's Plugin so `this` is the plugin context. Font URL replacement and the warning behavior are unchanged. --- .storybook/main.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 73605cf..200f60c 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -2,6 +2,7 @@ import type { StorybookConfig } from "@storybook/react-vite" import { readFileSync, realpathSync } from "node:fs" import { fileURLToPath } from "node:url" import path from "node:path" +import type { Plugin } from "vite" // Checkouts that share another checkout's node_modules (a linked git worktree whose node_modules is a junction) also // inherit that checkout's node_modules/@hm-design/* links. Those links point at the other checkout's packages/ui and its @@ -35,7 +36,7 @@ const localUiAliases = [ const UI_DIST_FONT_URL = /[^"'()\\\s]*\/ui\/dist\/fonts\/NotoSansKR-variable\.ttf/g const FONT_STATIC_URL = "/fonts/NotoSansKR-variable.ttf" -const hmUiThemeFontPath = { +const hmUiThemeFontPath: Plugin = { name: "hm-ui-theme-font-path", apply: "serve" as const, enforce: "post" as const,