diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index dee0f3a..5909da0 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -10,6 +10,7 @@ permissions: env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true' + NITRO_SINGLE_BUNDLE: '1' NITRO_JSON_MODE: 'legacy' jobs: diff --git a/vite.config.mjs b/vite.config.mjs index a5824be..0dfd049 100644 --- a/vite.config.mjs +++ b/vite.config.mjs @@ -93,7 +93,9 @@ const resolveJsonMode = () => }; const nitroJsonMode = resolveJsonMode(); +const nitroSingleBundle = process.env.NITRO_SINGLE_BUNDLE === '1'; process.stdout.write(`[vite] __NITRO_JSON_MODE__ = ${ nitroJsonMode }\n`); +process.stdout.write(`[vite] NITRO_SINGLE_BUNDLE = ${ nitroSingleBundle ? '1' : '0' }\n`); export default defineConfig({ base: process.env.VITE_BASE || './', @@ -165,7 +167,11 @@ export default defineConfig({ checks: { pluginTimings: false }, - output: { + output: nitroSingleBundle ? { + assetFileNames: 'src/assets/[name]-[hash].[ext]', + entryFileNames: 'assets/app.js', + inlineDynamicImports: true + } : { assetFileNames: 'src/assets/[name]-[hash].[ext]', // Granular chunking: split the monolithic vendor / nitro-renderer // bundles into smaller chunks so the browser can fetch them in