JavaScript
Architecture
The architecture takes inspiration from Chris Ferdinandi's How I structure my vanilla JS projects. Rather than keeping all JavaScript within a single file, code is split across a series of individual files and subdirectories within src/js
directory. This approach offers two main benefits:
- It makes the code easier to understand for developers
- We don't have to load all JavaScript on all pages
JS architecture details for developers.
Compiling and transpiling
Webpack concatenates and minifies the JS needed for the project into web/dist/js
. Babel is used for transpiling the JS into code for our supported browsers.