-
-
Notifications
You must be signed in to change notification settings - Fork 8
Support for top-level await #10
Comments
Hey @PaulLeCam what version of denopack are you using? Could you share your denopack config? |
Yes WASM is my assumption but that might be something else, this was just the most obvious difference I found between Here is a simple way I could reproduce the issue (I'm using Deno 1.3.0): File export { createHash } from 'https://deno.land/[email protected]/hash/mod.ts' And running: deno run --unstable --allow-env --allow-net --allow-read --allow-write https://deno.land/x/[email protected]/cli.ts bundle -i test.ts |
@PaulLeCam I have some good news and bad news:
I will leave this issue open as this is fairly annoying to anyone wanting to use std/hash |
Thanks for investigating! |
Yep, I'm thinking of a good way to support this going forward. I think I might need to change the Terser plugin back to minifying the bundle chunks instead of as a transform hook or something similar. Will test some approaches this week after I finished up the plugins I've been working on 😄 |
Thanks for renaming the issue btw 👍 |
I think I fixed this in a terser update a few weeks ago. |
Does Terser 5 support TLA now? |
I think that is why I updated it in the first place... can't remember now though. I'll check real quick. |
Oh never mind - I updated because optional chaining... so this is not fixed yet. |
Yeah I just checked and the issue regarding awaits on Terser's github is still open :c sucks but we'll keep an eye out on it ;) |
Hey, thanks for this project, it looks like a great way to bring nice Deno code to the browser!
Is your feature request related to a problem? Please describe.
I'd like to use denopack to bundle any deno
std
library not using theDeno
APIs.I tried bundling a project but it fails with
Uncaught Error: Terser is not supposed to return nothing!
.I narrowed down the problem to having
export { createHash } from 'https://deno.land/[email protected]/hash/mod.ts'
in mydeps.ts
file and my assumption, comparing with other imports fromstd
that can get compiled correctly, is that it's because thestd/hash
module uses WASM imports.Describe the solution you'd like
Rollup has a WASM plugin that would be great to support in denopack, either as a plugin or in core.
Alternatively, if there is an easy way to convert/wrap existing Rollup plugins to denopack ones it could be a good option.
Describe alternatives you've considered
Using
deno bundle
+ minifierThanks!
The text was updated successfully, but these errors were encountered: