Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update all non-major dependencies and fix "The entry point "vue" cannot be marked as external" error with nuxt 3.12 #634

Merged
merged 9 commits into from
Jun 15, 2024
6 changes: 6 additions & 0 deletions docs/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
export default defineNuxtConfig({
extends: '@nuxt-themes/docus',
modules: ['@nuxtjs/plausible'],
// Workaround for https://github.com/nuxt/nuxt/issues/27490
nitro: {
prerender: {
routes: ['/'],
},
},
})
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"test:watch": "vitest watch",
"test:coverage": "vitest --coverage"
},
"packageManager": "pnpm@9.1.4",
"packageManager": "pnpm@9.3.0",
"devDependencies": {
"@iconify-json/carbon": "^1.1.27",
"@nuxt/content": "^2.10.0",
Expand Down Expand Up @@ -96,6 +96,9 @@
"webpack",
"vue"
]
},
"overrides": {
"@nuxthq/studio": "^1.1.0"
}
},
"release-it": {
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook-nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@storybook-vue/nuxt",
"type": "module",
"version": "0.2.7",
"packageManager": "pnpm@9.1.4",
"packageManager": "pnpm@9.3.0",
"description": "Storybook for Nuxt and Vite: Develop Vue3 components in isolation with Hot Reloading.",
"license": "MIT",
"homepage": "https://github.com/storybook-vue/storybook-nuxt",
Expand Down
7 changes: 6 additions & 1 deletion packages/storybook-nuxt/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ async function defineNuxtConfig(baseConfig: {
ready: false,
dev: false,
overrides: {
// @ts-expect-error: this is actually correct, but would require to use generated types
appId: 'nuxt-app',
buildId: 'storybook',
ssr: false,
Expand Down Expand Up @@ -188,6 +187,12 @@ export const viteFinal: StorybookConfig['viteFinal'] = async (
const nuxtConfig = await defineNuxtConfig(
await getStorybookViteConfig(config, options),
)
// Storybook adds 'vue' as dependency that should be optimized, but nuxt explicitly excludes it from pre-bundling
// Prioritize `optimizeDeps.exclude`. If same dep is in `include` and `exclude`, remove it from `include`
nuxtConfig.viteConfig.optimizeDeps!.include =
nuxtConfig.viteConfig.optimizeDeps!.include!.filter(
(dep) => !nuxtConfig.viteConfig.optimizeDeps!.exclude!.includes(dep),
)

return mergeConfig(nuxtConfig.viteConfig, {
// build: { rollupOptions: { external: ['vue', 'vue-demi'] } },
Expand Down
Loading
Loading