Skip to content

Commit b9ca070

Browse files
authored
pass through sourcemap setting
1 parent b92c5e2 commit b9ca070

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export default {
66
...initialOptions,
77
bundle: true,
88
format: 'esm',
9-
sourcemap: false,
109
write: false,
1110
metafile: true
1211
}
@@ -18,10 +17,11 @@ export default {
1817

1918
onLoad({filter: /.*/, namespace: 'eval'}, async ({path}) => {
2019
let {metafile, outputFiles} = await esbuild.build({...options, entryPoints: [path]})
20+
let file = outputFiles.find(f => /\.m?js$/.test(f.path))
2121
let watchFiles = Object.keys(metafile.inputs)
2222
let dataurl = await new Promise(cb => {
2323
let reader = new FileReader()
24-
let blob = new Blob([outputFiles[0].contents])
24+
let blob = new Blob([file.contents])
2525
reader.onload = () => cb(reader.result)
2626
reader.readAsDataURL(blob)
2727
})

0 commit comments

Comments
 (0)