Dev environment - ReiniervanLimpt/project-tech-21 GitHub Wiki

Ive set up my dev environment and workflow with some (pre) scripts: package file npm run dev now starts my server and has nodemon watching over any changes i make in my server.js and all connected modules (nodemon restarts the server every time i do).

predev

Ive also included a predev script that runs build:css which is specified in my gulpfile.js pipeline to build css from ./src/styles.scss (which is sass) and place the compiled css file in public/dist.

prebuild

The dist folder will be emptied and filled with a new css file every time i call npm run dev by running a script prebuild that runs rimraf ./public/dist which is a prebuild:css script so this will always happen right before the css is built.

watcher

On top of that ive included a watch:css script which watches my src folder for any changes i make to my css and html (hbs) files and proxies a server to port 3001 by using browsersync, every time i make changes to css this refreshes the page with the new css changes ive made.

Heres a link to the gulpfile which includes the sass and watch script.

Resources used:

browsersync gulp rimraf nodemon handlebars templating