Skip to content

Commit 99c6946

Browse files
committed
nuxt+storybook integration workaround
1 parent a90e393 commit 99c6946

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

nuxt.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import process from 'node:process'
22
import { currentLocales } from './config/i18n'
33
import { isCI, provider } from 'std-env'
44

5+
const isStorybook = process.env.STORYBOOK === 'true' || process.env.VITEST_STORYBOOK === 'true'
6+
57
export default defineNuxtConfig({
68
modules: [
79
'@unocss/nuxt',
@@ -14,7 +16,7 @@ export default defineNuxtConfig({
1416
'@vite-pwa/nuxt',
1517
'@vueuse/nuxt',
1618
'@nuxtjs/i18n',
17-
'@nuxtjs/color-mode',
19+
isStorybook ? undefined : '@nuxtjs/color-mode',
1820
],
1921

2022
colorMode: {
@@ -139,9 +141,7 @@ export default defineNuxtConfig({
139141
},
140142

141143
experimental: {
142-
entryImportMap: false,
143-
typescriptPlugin: true,
144-
viteEnvironmentApi: true,
144+
viteEnvironmentApi: !isStorybook,
145145
typedPages: true,
146146
},
147147

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
"test:types": "pnpm generate:lexicons && nuxt prepare && vue-tsc -b --noEmit && pnpm --filter npmx-connector test:types",
4444
"test:unit": "vite test --project unit",
4545
"start:playwright:webserver": "NODE_ENV=test pnpm preview --port 5678",
46-
"storybook": "storybook dev -p 6006",
47-
"build-storybook": "storybook build"
46+
"storybook": "STORYBOOK=true storybook dev -p 6006",
47+
"build-storybook": "STORYBOOK=true storybook build"
4848
},
4949
"dependencies": {
5050
"@atproto/api": "^0.18.17",

0 commit comments

Comments
 (0)