mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 15:06:20 +00:00
Fix release bundle chunk loading
This commit is contained in:
@@ -10,6 +10,7 @@ permissions:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
|
||||||
|
NITRO_SINGLE_BUNDLE: '1'
|
||||||
NITRO_JSON_MODE: 'legacy'
|
NITRO_JSON_MODE: 'legacy'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|||||||
+7
-1
@@ -93,7 +93,9 @@ const resolveJsonMode = () =>
|
|||||||
};
|
};
|
||||||
|
|
||||||
const nitroJsonMode = 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_JSON_MODE__ = ${ nitroJsonMode }\n`);
|
||||||
|
process.stdout.write(`[vite] NITRO_SINGLE_BUNDLE = ${ nitroSingleBundle ? '1' : '0' }\n`);
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
base: process.env.VITE_BASE || './',
|
base: process.env.VITE_BASE || './',
|
||||||
@@ -165,7 +167,11 @@ export default defineConfig({
|
|||||||
checks: {
|
checks: {
|
||||||
pluginTimings: false
|
pluginTimings: false
|
||||||
},
|
},
|
||||||
output: {
|
output: nitroSingleBundle ? {
|
||||||
|
assetFileNames: 'src/assets/[name]-[hash].[ext]',
|
||||||
|
entryFileNames: 'assets/app.js',
|
||||||
|
inlineDynamicImports: true
|
||||||
|
} : {
|
||||||
assetFileNames: 'src/assets/[name]-[hash].[ext]',
|
assetFileNames: 'src/assets/[name]-[hash].[ext]',
|
||||||
// Granular chunking: split the monolithic vendor / nitro-renderer
|
// Granular chunking: split the monolithic vendor / nitro-renderer
|
||||||
// bundles into smaller chunks so the browser can fetch them in
|
// bundles into smaller chunks so the browser can fetch them in
|
||||||
|
|||||||
Reference in New Issue
Block a user