When dynamically importing CSS files in a conditional, all imported CSS files are bundled into a single file instead of being split into multiple files. This results in a large bundle file that combines all CSS rules, causing conflicts with the CSS stylesheets that are used in different parts of the application.
Expected Result:
The dynamically imported CSS files should be split into multiple files, each containing the CSS rules specific to that file, even when using a conditional statement to load the files based on a query string.
Actual Result:
All imported CSS files are bundled into a single file, resulting in a large file that combines all CSS rules, causing conflicts with the CSS stylesheets used in different parts of the application, even when using build.cssCodeSplit set to true.
Describe the bug
When dynamically importing CSS files in a conditional, all imported CSS files are bundled into a single file instead of being split into multiple files. This results in a large bundle file that combines all CSS rules, causing conflicts with the CSS stylesheets that are used in different parts of the application.
Expected Result: The dynamically imported CSS files should be split into multiple files, each containing the CSS rules specific to that file, even when using a conditional statement to load the files based on a query string.
Actual Result: All imported CSS files are bundled into a single file, resulting in a large file that combines all CSS rules, causing conflicts with the CSS stylesheets used in different parts of the application, even when using build.cssCodeSplit set to true.
Reproduction
https://stackblitz.com/edit/histoire-vue3-starter-euqwza?file=package.json
System Info
Used Package Manager
npm
Validations