There was an error while loading. Please reload this page.
1 parent 954cc10 commit e3cfb9dCopy full SHA for e3cfb9d
1 file changed
packages/vite/src/node/optimizer/index.ts
@@ -855,15 +855,17 @@ async function prepareRolldownOptimizerRun(
855
await bundle.close()
856
throw new Error('The build was canceled')
857
}
858
- const result = await bundle.write({
859
- ...rolldownOptions.output,
860
- format: 'esm',
861
- sourcemap: true,
862
- dir: processingCacheDir,
863
- entryFileNames: '[name].js',
864
- })
865
- await bundle.close()
866
- return result
+ try {
+ return await bundle.write({
+ ...rolldownOptions.output,
+ format: 'esm',
+ sourcemap: true,
+ dir: processingCacheDir,
+ entryFileNames: '[name].js',
+ })
+ } finally {
867
+ await bundle.close()
868
+ }
869
870
871
function cancel() {
0 commit comments