Enhancement: Minify CSS when adding adding a CSS Preprocessor such as Sass
Created by: guylepage3
Enhancement: Request for pull request
Add command to minify CSS when adding Adding a CSS Preprocessor (Sass, Less etc.) to your Create React App.
Currently
When adding a CSS preprocessor, the addition of the following script lines produces an App.css
file that is not minified.
"scripts": {
+ "build-css": "node-sass-chokidar src/ -o src/",
+ "watch-css": "npm run build-css && node-sass-chokidar src/ -o src/ --watch --recursive",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
I'd like to propose adding a line to let developers know that they can simply add --output-style compressed
to the watch-css
line if someone would like to minify their compiled scss.