DEV Community

Discussion on: Build a very basic SPA JavaScript router

Collapse
 
labzdjee profile image
Gérard Gauthier

Hello, good base for adding routes in an SPA. Inspirational. That's why I took this as an example, adding title dynamic update (gives a more readable history), programmatic call to links (well not too proud of the trick I used, any suggestion welcome).
As I had to test how ES6+ code with import/require on modules, CSS variables, assets can be comprehensively be transpiled and bundled with Webpack (never did that because Vue.js took care of this for me up to now), I restructured this code to make it work under Internet Explorer (another constraint I had to work on).
If you're interested it is here: github.com/LabZDjee/basic-router.
It works in development (live server) and production modes with source maps.