diff --git a/vike/node/plugin/plugins/buildConfig.ts b/vike/node/plugin/plugins/buildConfig.ts index 5a7dfaa760..12b18146b3 100644 --- a/vike/node/plugin/plugins/buildConfig.ts +++ b/vike/node/plugin/plugins/buildConfig.ts @@ -84,7 +84,10 @@ function buildConfig(): Plugin { buildStart() { assertNodeEnv() }, - async writeBundle(options, bundle) { + writeBundle: { + order: 'post', + sequential: true, + async handler(options, bundle) { if (isSsrBuild) { // Ideally we'd move dist/_temp_manifest.json to dist/server/client-assets.json instead of dist/assets.json // - But we can't because there is no guarentee whether dist/server/ is generated before or after dist/client/ (generating dist/server/ after dist/client/ erases dist/server/client-assets.json) @@ -102,6 +105,7 @@ function buildConfig(): Plugin { await fs.rm(serverManifestFilePath) await set_constant_ASSETS_MAP(options, bundle) } + } } } }