feat: configure workers env and enforce compatibility
Enhances Cloudflare Workers configuration and compatibility settings: - Enables worker execution based on provider/runtime conditions - Sets compatibility date specifically for Cloudflare to 2025-05-08 - Enforces module compatibility through experimental flag - Configures Wrangler with proper asset bindings and server entry point This update improves deployment reliability and ensures consistent behavior across different environments.
This commit is contained in:
parent
125af3a567
commit
13b3f5a8ea
2 changed files with 16 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { provider, runtime } from 'std-env'
|
||||||
import { currentLocales } from './i18n/i18n'
|
import { currentLocales } from './i18n/i18n'
|
||||||
|
|
||||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||||
|
|
@ -57,7 +58,13 @@ export default defineNuxtConfig({
|
||||||
compatibilityVersion: 4,
|
compatibilityVersion: 4,
|
||||||
},
|
},
|
||||||
|
|
||||||
compatibilityDate: '2024-07-08',
|
experimental: {
|
||||||
|
enforceModuleCompatibility: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
compatibilityDate: {
|
||||||
|
cloudflare: '2025-05-08',
|
||||||
|
},
|
||||||
|
|
||||||
nitro: {
|
nitro: {
|
||||||
experimental: {
|
experimental: {
|
||||||
|
|
@ -89,6 +96,7 @@ export default defineNuxtConfig({
|
||||||
cache: false,
|
cache: false,
|
||||||
database: false,
|
database: false,
|
||||||
kv: true,
|
kv: true,
|
||||||
|
workers: (provider === 'cloudflare_workers' || runtime === 'node') && provider !== 'cloudflare_pages',
|
||||||
},
|
},
|
||||||
|
|
||||||
eslint: {
|
eslint: {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,12 @@
|
||||||
|
name = "sink"
|
||||||
|
main = "dist/server/index.mjs"
|
||||||
|
compatibility_date = "2025-05-08"
|
||||||
upload_source_maps = true
|
upload_source_maps = true
|
||||||
|
|
||||||
|
[assets]
|
||||||
|
directory = "dist/public"
|
||||||
|
binding = "ASSETS"
|
||||||
|
|
||||||
[dev]
|
[dev]
|
||||||
port = 3000
|
port = 3000
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue