Skip to content

Commit 7ff0a44

Browse files
Zip: remove invalid .catch on archiver.finalize; copy shared.js.map in dev
- archiver.finalize() is not a promise; attach error via 'error' event and wrap in try/catch - Include shared.js.map in dev copies to keep DevTools source maps complete
1 parent 7bad746 commit 7ff0a44

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

build.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,11 @@ async function zipFolder(dir) {
423423
output.on('close', resolve)
424424
archive.pipe(output)
425425
archive.directory(dir, false)
426-
archive.finalize().catch(onError)
426+
try {
427+
archive.finalize()
428+
} catch (err) {
429+
onError(err)
430+
}
427431
})
428432
}
429433

@@ -474,6 +478,7 @@ async function finishOutput(outputDirSuffix, sourceBuildDir = outdir) {
474478
...(isProduction
475479
? []
476480
: [
481+
{ src: `${sourceBuildDir}/shared.js.map`, dst: 'shared.js.map' },
477482
{ src: `${sourceBuildDir}/content-script.js.map`, dst: 'content-script.js.map' },
478483
{ src: `${sourceBuildDir}/background.js.map`, dst: 'background.js.map' },
479484
{ src: `${sourceBuildDir}/popup.js.map`, dst: 'popup.js.map' },

0 commit comments

Comments
 (0)