Skip to content

Commit 891a1a6

Browse files
committed
fixed statics assets path/module mismatches
1 parent ccd50bc commit 891a1a6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/plugins/static-assets.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ export default defineNitroPlugin((nitroApp) => {
2424
// Get the file path - remove /_nuxt/ prefix
2525
const filePath = url.replace('/_nuxt/', '')
2626

27-
// During preview, Nitro runs from .output/ directory
28-
// So process.cwd() is already .output/, so we use public/_nuxt/
29-
const outputPath = join(process.cwd(), 'public/_nuxt', filePath)
27+
// In production, PM2 runs from the project root, not .output/
28+
// So we need to go to .output/public/_nuxt/ from the project root
29+
const outputPath = join(process.cwd(), '.output/public/_nuxt', filePath)
3030

3131
console.log('[Static Assets Plugin] Looking for file at:', outputPath)
3232

0 commit comments

Comments
 (0)