From 4852c4c15a82bf583070a085921a6e5f2a2c1080 Mon Sep 17 00:00:00 2001 From: Keiichiro Amemiya Date: Mon, 19 Jun 2023 01:41:41 +0900 Subject: [PATCH 1/2] fix(builder-vite): use user's build.target --- code/builders/builder-vite/src/vite-config.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/builders/builder-vite/src/vite-config.ts b/code/builders/builder-vite/src/vite-config.ts index c7b363622bcc..a932937511f0 100644 --- a/code/builders/builder-vite/src/vite-config.ts +++ b/code/builders/builder-vite/src/vite-config.ts @@ -66,6 +66,10 @@ export async function commonConfig( // If an envPrefix is specified in the vite config, add STORYBOOK_ to it, // otherwise, add VITE_ and STORYBOOK_ so that vite doesn't lose its default. envPrefix: userConfig.envPrefix ? ['STORYBOOK_'] : ['VITE_', 'STORYBOOK_'], + // Pass build.target option from user's vite config + build: { + target: buildProperty?.target + }, }; const config: ViteConfig = mergeConfig(userConfig, sbConfig); From 21b39eb40b3b68012da4ead7d2abaa888439e97f Mon Sep 17 00:00:00 2001 From: Keiichiro Amemiya Date: Thu, 22 Jun 2023 04:07:30 +0900 Subject: [PATCH 2/2] chore: eslint error fix --- code/builders/builder-vite/src/vite-config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/builders/builder-vite/src/vite-config.ts b/code/builders/builder-vite/src/vite-config.ts index a932937511f0..33e5f5d38b34 100644 --- a/code/builders/builder-vite/src/vite-config.ts +++ b/code/builders/builder-vite/src/vite-config.ts @@ -68,7 +68,7 @@ export async function commonConfig( envPrefix: userConfig.envPrefix ? ['STORYBOOK_'] : ['VITE_', 'STORYBOOK_'], // Pass build.target option from user's vite config build: { - target: buildProperty?.target + target: buildProperty?.target, }, };