From 0aa51ae807c2054abcfc1166b98c441ba5d2af2c Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Wed, 8 Feb 2023 21:09:58 +0100 Subject: [PATCH 1/2] fix(cloudflare): use full mime db --- src/presets/cloudflare.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/presets/cloudflare.ts b/src/presets/cloudflare.ts index 12ea6bdcfc..289c168a49 100644 --- a/src/presets/cloudflare.ts +++ b/src/presets/cloudflare.ts @@ -35,6 +35,10 @@ export const cloudflarePages = defineNitroPreset({ output: { serverDir: "{{ rootDir }}/functions", }, + alias: { + // Hotfix: Cloudflare appends /index.html if mime is not found and things like ico are not in standard lite.js! + _mime: "mime/index.js", + }, rollupConfig: { output: { entryFileNames: "path.js", From 3d29b4288102bfa9b61f3e231898abdf75b926eb Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Wed, 8 Feb 2023 21:14:00 +0100 Subject: [PATCH 2/2] add link to pr for context --- src/presets/cloudflare.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/presets/cloudflare.ts b/src/presets/cloudflare.ts index 289c168a49..465c9ab5dc 100644 --- a/src/presets/cloudflare.ts +++ b/src/presets/cloudflare.ts @@ -37,6 +37,7 @@ export const cloudflarePages = defineNitroPreset({ }, alias: { // Hotfix: Cloudflare appends /index.html if mime is not found and things like ico are not in standard lite.js! + // https://github.com/unjs/nitro/pull/933 _mime: "mime/index.js", }, rollupConfig: {