How do deno devs bundle .js for browser projects? (SPAs, chrome extensions, etc)
Is the easiest option to tell
deno
to emit a node_modules
subdirectory so I can use esbuild
? I'm trying to minimize configuration as much as possible.6 Replies
You can use esbuild, but since esbuild is built for Node specifically, it needs to understand how Deno resolves imports and stuff like that, so you'll need a plugin to instruct esbuild, you can use this: https://jsr.io/@duesabati/esbuild-deno-plugin
Thanks, does that require writing my own .ts file to do building? I was hoping to run a CLI, an
esbuild
invocation in my justfile
/ makefile
, or something like that.
so I get all the benefits of a nice CLI: --watch
, etcI don't think you can pass plugins to the CLI but the JS API are very straight forward and do support watching
active projects that I know of:
- https://github.com/orgsofthq/dsbuild
- https://github.com/nhrones/Devtools_Hot
- https://github.com/twosaturdayscode/esbuild-deno-plugin
- https://github.com/lucacasonato/esbuild_deno_loader
Also check out this issue: https://github.com/denoland/deno/issues/27862
GitHub
GitHub - orgsofthq/dsbuild: 📦 Build modern websites with zero added...
📦 Build modern websites with zero added frameworks. Deno, React, JS/TS, & Markdown MDX supported. - orgsofthq/dsbuild
GitHub
GitHub - nhrones/Devtools_Hot
Contribute to nhrones/Devtools_Hot development by creating an account on GitHub.
GitHub
GitHub - twosaturdayscode/esbuild-deno-plugin: Deno modules resolut...
Deno modules resolution and loading for esbuild. Contribute to twosaturdayscode/esbuild-deno-plugin development by creating an account on GitHub.
GitHub
GitHub - lucacasonato/esbuild_deno_loader: Deno module resolution f...
Deno module resolution for
esbuild
. Contribute to lucacasonato/esbuild_deno_loader development by creating an account on GitHub.GitHub
Tracking issue for refactors to support external bundlers · Issue #...
Tracking issue for refactorings occurring internally in the Deno codebase to support external bundlers. Most of this work is done, but still a bit to do.
Yeah I've encountered them while searching for esbuild compatibility as you can see one of those packages is written by me
I'm currently using it in my own project