I notice that there is a plain CSS file in the public directory, this is fine but you might gain a lot from pre-compilation for browser compatibility and ease of use with variables, include, and extends.
So a setup for this would be something like:
npm install --save sass
Add a run line to your package.json scripts like these:
"dev": "cross-env NODE_ENV=development nodemon index && npm run scss-watch"
Add an explicit start script:
"start": "npm run scss-build && node index.js"
Then, you just edit your style.scss file, and it will build into style.css. Now you have a master control to split your scss files out into multiple places, and build them one into a single file. You should also look into minifying, generating a .map and running something like postcss for better compatibility.
I notice that there is a plain CSS file in the public directory, this is fine but you might gain a lot from pre-compilation for browser compatibility and ease of use with variables, include, and extends.
So a setup for this would be something like:
npm install --save sass
package.json
scripts like these:dev
script:start
script:Then, you just edit your
style.scss
file, and it will build intostyle.css
. Now you have a master control to split yourscss
files out into multiple places, and build them one into a single file. You should also look into minifying, generating a.map
and running something like postcss for better compatibility.