I am about starting a react application which I want to implement sass as my css preprocessor, all the resources I have consulted are all referring me to still using the default App.css file to just renaming it to App.scss. but my issue is I don't want to use the default I want to set up my own sass files in a different directory within my root directory.
1 Answer
So you can start in any directory you would want to, but make sure that you're bundling with in your root <Component /> in the case of a create-react-app generated app you could import your root SASS file in the <App /> or index.js. You will be able to bundle your sass this way.
2 Comments
Kingsley Akindele
yeah thanks for this, this works! but what of if I want it to compile to a CSS file within my app so I can just bundle that CSS file to my root component, cos I really don't want my styling to look like an internal styling after compilation (as that is the result of bundling a sass file to a component directly) ??
Claeusdev
Hmmm, I honestly don't get what you mean though. Could you explain why you'd need it to compile to CSS? you could eject your webpack config and then update it to how you see fit. Which I think will be a pain in the ass.. honestly