I am working on a React project which uses a style.css file - which is, in turn, generated from two source CSS files, which I shall call file1.css and file2.css - but when I try to build it using vite build, the generated CSS file (index + some letters and numbers.css) does not have all the styles.
The style.css file is generated correctly from the two source files, but the index file only contains only some of the styles. Both file1.css and file2.css are imported on the project's TSX files.
Moreover, even for the styles which are included, the generated file does not reflect any changes. In other words, changing a style in file1.css or file2.css causes style.css to be modified, but not the index file generated by Vite.
What could the problem be?
I am working on a React project which uses a style.css file - which is, in turn, generated from two source CSS files, which I shall call file1.css and file2.css - but when I try to build it using vite build, the generated CSS file (index + some letters and numbers.css) does not have all the styles.
The style.css file is generated correctly from the two source files, but the index file only contains only some of the styles. Both file1.css and file2.css are imported on the project's TSX files.
Moreover, even for the styles which are included, the generated file does not reflect any changes. In other words, changing a style in file1.css or file2.css causes style.css to be modified, but not the index file generated by Vite.
What could the problem be?
Share Improve this question edited Mar 17 at 16:31 Gabriela asked Mar 17 at 16:10 GabrielaGabriela 316 bronze badges 1- Please note that these are static CSS files - with a global scope - and not module css files. – Gabriela Commented Mar 17 at 16:11
1 Answer
Reset to default 0Solved... It was simpler than expected. It was reading style.css in the wrong path. My sincere apologies.