Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jed committed Nov 29, 2022
2 parents 4ccf8e0 + b9ca070 commit 71ef8e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mod.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export default {
...initialOptions,
bundle: true,
format: 'esm',
sourcemap: 'inline',
write: false,
metafile: true
}
Expand All @@ -18,10 +17,11 @@ export default {

onLoad({filter: /.*/, namespace: 'eval'}, async ({path}) => {
let {metafile, outputFiles} = await esbuild.build({...options, entryPoints: [path]})
let file = outputFiles.find(f => /\.m?js$/.test(f.path))
let watchFiles = Object.keys(metafile.inputs)
let dataurl = await new Promise(cb => {
let reader = new FileReader()
let blob = new Blob([outputFiles[0].contents])
let blob = new Blob([file.contents])
reader.onload = () => cb(reader.result)
reader.readAsDataURL(blob)
})
Expand Down

0 comments on commit 71ef8e9

Please sign in to comment.