How do I bundle with deno (with javascript) instead of esbuild?
I have the following project structure:
which produce:
I would like to create two bundles:
1. loader.mjs which contains both 'static' dependencies, those imported like:
and a dynamically imported frontend (hot-reloaded manually) like:
2. frontend.mjs which is not really a bundle but is frontend.mts de-typescripted [+minified for production]
* frontend.mjs also does
* the result is that a small frontend.mjs is dynamically reloaded by loader.mjs but the common dependencies are not hot reloaded
The end result is that I have:
* loader.mjs containing the frontend-hotloader and common dependencies loaded in the html via <script>
* frontend.mjs which will be hot reloaded
I'm not sure how to do this with Deno or whether it's even the right tool. My key requirements are:
* the frontend should not reload its dependencies when hot-reloading (since the loader.mjs bundle should already contain them)
* bundling should be almost as fast as esbuild (i.e. instant, pretty much)
* it should not be a PITA
Thank you for reading this far and any advice is appreciated!
Ell
which produce:
I would like to create two bundles:
1. loader.mjs which contains both 'static' dependencies, those imported like:
and a dynamically imported frontend (hot-reloaded manually) like:
2. frontend.mjs which is not really a bundle but is frontend.mts de-typescripted [+minified for production]
* frontend.mjs also does
import * as THREE from "threejs" but I want this to be marked as external when "bundling" because it will already be present in the loader.mjs bundle* the result is that a small frontend.mjs is dynamically reloaded by loader.mjs but the common dependencies are not hot reloaded
The end result is that I have:
* loader.mjs containing the frontend-hotloader and common dependencies loaded in the html via <script>
* frontend.mjs which will be hot reloaded
I'm not sure how to do this with Deno or whether it's even the right tool. My key requirements are:
* the frontend should not reload its dependencies when hot-reloading (since the loader.mjs bundle should already contain them)
* bundling should be almost as fast as esbuild (i.e. instant, pretty much)
* it should not be a PITA
Thank you for reading this far and any advice is appreciated!
Ell
