Closed steinbro closed 2 days ago
When you say "compiled to a single JS file" is this referring to a "bundle.js" file (as per Webpack documentation) that is then referenced in index.html? It seems there are a couple different ways to use Webpack so we aren't totally sure what the end goal is.
Yes, making a single bundle.js was what I had in mind. You'll notice that there are over 15 separate files within app/js/. This modularity is considered good for development but bad for deployment, since each browser would have to make separate HTTP requests for each asset.
The nice part about the current non-bundled setup is that deployment is trivial: on each push, the contents of the repo are pushed to Github Pages. This currently works because there is no build process. Once we add a packaging step, we will need some sort of build automation as part of the deploy. Here's some relevant documentation: https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#creating-a-custom-github-actions-workflow-to-publish-your-site
We've started using Vite as of #27, so the JS packaging is covered now.
We currently pull in some third party libraries (Turf.js, Leaflet.js) by linking to CDN-hosted versions, and our own code is split across many separate JS files for modularity. This should really all be packaged up and compiled down to a single JS file. Investigate using Webpack or similar tools.
Consider using for audio assets as well.