Skip to content

Commit c20d90e

Browse files
committed
fix: without nitro, don't modify webpack manifest, and throw error for vite
resolves #530
1 parent 9feadc0 commit c20d90e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/module.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ export default defineNuxtModule({
4141
throw new Error('[bridge] Bridge must be enabled by using `defineNuxtConfig` to wrap your Nuxt configuration.')
4242
}
4343

44+
if (opts.vite && !opts.nitro && !nuxt.options.dev) {
45+
throw new Error('[bridge] Vite build will not work unless Nitro is enabled.')
46+
}
47+
4448
if (opts.nitro) {
4549
nuxt.hook('modules:done', async () => {
4650
await setupNitroBridge()
@@ -65,7 +69,7 @@ export default defineNuxtModule({
6569
// with webpack, we need to transpile vue to handle the default/named exports in Vue 2.7
6670
nuxt.options.build.transpile.push('vue')
6771
nuxt.hook('build:done', async () => {
68-
if (!nuxt.options.dev && !nuxt.options._prepare) {
72+
if (opts.nitro && !nuxt.options.dev && !nuxt.options._prepare) {
6973
await generateWebpackBuildManifest()
7074
}
7175
})

0 commit comments

Comments
 (0)