I'm a newbie at Reactjs. When converting HTML to JSX Component, i notice that developers always device CSS files into smaller part and import it in JSX Component. I wonder why they not aggregate into 1 file and import it in Puclic folder. Thanks in advance for your help! :D
Asked
Active
Viewed 257 times
0
-
Answered here: https://stackoverflow.com/questions/2336302/single-huge-css-file-vs-multiple-smaller-specific-css-files – muskrat_ Mar 27 '20 at 06:59
-
For the same reason it's a good idea to have lots of smaller JavaScript files. Much more maintainable / composable code. And then leave the bundler to bundle into single large files. – Keith Mar 27 '20 at 07:04
-
thanks `muskrat_` and `Keith` – Linh Ha Mar 27 '20 at 09:05
1 Answers
0
If you have created your react project using the cli tool "create-react-app" it is using webpack as module bundler.
Webpack doesn't read anything in the public folder it only reads from src folder so it is advised to placed the css/stylesheets in your src folder.

srikanth
- 9
- 2