Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,13 @@ export default defineNuxtConfig({
]
},

// nitro: {
// cloudflare: {
// wrangler: {
// compatibility_flags: ['nodejs_compat_v2']
// }
// }
// },

compatibilityDate: '2024-08-08'
})
9 changes: 9 additions & 0 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ export default defineNuxtModule<ModuleOptions>({
}
})
runtimeConfig.hub = hub
// Make sure to tell Nitro to not generate the wrangler.toml file
// @ts-expect-error nitro.cloudflare.wrangler is not yet typed
delete nuxt.options.nitro.cloudflare?.wrangler?.compatibility_flags
// @ts-expect-error nitro.cloudflare.wrangler is not yet typed
if (nuxt.options.nitro.cloudflare?.wrangler && Object.keys(nuxt.options.nitro.cloudflare.wrangler).length) {
log.warn('The `nitro.cloudflare.wrangler` option is not supported by NuxtHub, ignoring it...')
// @ts-expect-error nitro.cloudflare.wrangler is not yet typed
nuxt.options.nitro.cloudflare.wrangler = {}
}
// validate remote option
if (hub.remote && !['true', 'production', 'preview'].includes(String(hub.remote))) {
log.error('Invalid remote option, should be `false`, `true`, `\'production\'` or `\'preview\'`')
Expand Down