Skip to content

Commit

Permalink
further ensure writeBundle() execution order (#1051)
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Feb 20, 2024
1 parent 49fe40c commit df07c4d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vike/node/plugin/plugins/buildConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -102,6 +105,7 @@ function buildConfig(): Plugin {
await fs.rm(serverManifestFilePath)
await set_constant_ASSETS_MAP(options, bundle)
}
}
}
}
}
Expand Down

0 comments on commit df07c4d

Please sign in to comment.