Mistake in adding CSS Preprocessor documentation
Created by: KevinBacas
Description
Hello everyone, I am reporting an error in the documentation concerning this section.
In fact, if you follow this tutorial, you modify the "build" script to "build": "react-scripts build && npm run build-css"
. There is two problems here:
- You run
react-scripts build
before processing sass files. So you may not have the latest version of the css file. - On a CI server, if you start only from the sources from git, you won't have any .css file created so it returns an error (see below).
Expected behavior
The build script should be: npm run build-css && react-scripts build
. So it prevents those issues.
Actual behavior
$ react-scripts build && npm run build-css
Creating an optimized production build...
Failed to compile.
Module not found: Error: Cannot resolve 'file' or 'directory' ./index.css
Environment
Run these commands in the project folder and fill in their results:
-
npm ls react-scripts
(if you haven’t ejected):
my-app@0.1.0 C:\Users\Kevbac\Documents\git\my-app
`-- react-scripts@0.9.0
-
node -v
: v6.9.0 -
npm -v
: 3.10.8
Then, specify:
- Operating system: Windows 10
- Browser and version:
Reproducible Demo
I just followed the turtorial with a CRA app from scratch.
git clone https://github.com/KevinBacas/my-app
cd my-app
npm install
npm run build # This will throw an error
BTW thank you for documenting this, I'll submit a PR with the little fix attached to this issue.