Skip to content

Commit

Permalink
fix: throw error if wrapper isn't used (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Jul 13, 2022
1 parent e8de851 commit 686e3a9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ export default defineNuxtModule({
// Disable if users explicitly set to false
if ((nuxt.options as any).bridge === false) { return }

const _require = createRequire(import.meta.url)
if (!(nuxt.options as any).bridge._version) {
throw new Error('[bridge] Bridge must be enabled by using `defineNuxtConfig` to wrap your Nuxt configuration.')
}

if (opts.nitro) {
nuxt.hook('modules:done', async () => {
Expand All @@ -63,6 +65,7 @@ export default defineNuxtModule({
nuxt.options.build.transpile.push('vue')
}
if (opts.postcss8) {
const _require = createRequire(import.meta.url)
await installModule(_require.resolve('@nuxt/postcss8'))
}
if (opts.typescript) {
Expand Down

0 comments on commit 686e3a9

Please sign in to comment.