Some webdev knowledge gained
Easlier this year I had to split a Koa/SPA app into two separate apps. As part of that I switched from webpack to Neutrino.
Through this work I learned a lot about full stack development (frontend, backend and deployments for both). I could write a blog post per item, however, listing it all in here is better than never getting to write a post for any of them.
Note, I’m pointing to commits that I believe have enough information to understand what I learned.
Npm packages to the rescue:
Node/backend notes:
- How to better configure HMR
- Make HMR work by closing the previous server
- Add source-map-support to help development
- Start project on debugging mode (use
--inspect
rather thaninspect
) - How to properly start Neutrino in production
Neutrino has been a great ally to me and here’s some knowledge on how to use it:
- Add PostCss support
- Specify custom env variables to be passed down into the app
- Add a favicon.ico to your app
- Configure Travis to use
--inspect
with Neutrino after any failures - Include a custom font to your SPA
- How to properly call Neutrino with Istanbul
Heroku was my tool for deployment and here you have some specific notes:
- Add a postbuild script for Heroku as well as adding a static.json to configure how to server the frontend code
- Tell the server to send all routes from the root (since we use dynamic routing via React-router)
- Same change but for Netlify
- Changes to enable Heroku review apps and configue for SPAs