Closed
Description
Description
if you configure vite to use postcss+autoprefixer, at some point svelte's virtual css files will be processed.
browserlist will see the cssId from
looks something like "/src/App.svelte.css?svelte&type=style"
browserlist cant resolve that path to find a package.json / .browserslistrc and uses default settings.
Reproduction
https://github.com/days-later/vite-plugin-svelte-test
- npm run build
- css in dist/assets/index.xxxx.css is not prefixed
Additional Information
to solve the issue:
- set browserlist explicitly with autoprefixers overrideBrowserslist option
- change cssId, eg:
const cssId = root + createVirtualImportId(normalizedFilename, 'style', timestamp);
... not sure if that has side effects. (when using '.' instead of root, rollup tries to load the file)