I have an app that is built with react-static. I noticed that CSS for all pages (routes) are merged into one big styles.css file. Is it possible to generate separate CSS files for each page?
Now if I run build
command there is one css file in the dist folder with css for both pages, I want to get separate css files for MainPage and AboutPage.
This is how my static.config.js
file look like:
export default {
getRoutes: async () => {
return [
{
path: '/',
template: 'src/pages/MainPage/MainPage.js',
},
{
path: 'about',
template: 'src/pages/AboutPage/AboutPage.js',
},
]
},
plugins: [
require.resolve('react-static-plugin-sass'),
require.resolve('react-static-plugin-reach-router'),
require.resolve('react-static-plugin-sitemap'),
],
}
And here is the full code: https://github.com/annmirosh/react-static-test
Appreciate your help!