You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've realized that something wrong was happening when changing imports on my .js files. For some reason, sometimes a content that should not be put on the final bundle is prepended to it instead.
How to reproduce:
clone the following sample repository: git clone https://github.com/juniorgarcia/rollup-postcss-rebuild-error
install deps: npm install
open the project on VSCode or any other
start the dev mode: npm run dev
open the files src/index.js and dist/bundle.css and put them side by side
on src/index.js, uncomment // import './foo.css' (here everything works as expected)
now comment // import './foo.css' again
the content of bundle.css is now generated wrongly:
body {
z-index: 2; /* this line is from `foo.css` which is prepended to the bundle.css instead of being removed */
}
@import url('https://fonts.googleapis.com/css2?family=Work+Sans&display=swap');
body {
z-index: 1;
}
I started to realize this when using Linaria in my stack. After thinking that Linaria plugins was causing this, I tried the simplest stack possible without anything other than PostCSS plugin and the erro persists.
I've realized that something wrong was happening when changing imports on my .js files. For some reason, sometimes a content that should not be put on the final bundle is prepended to it instead.
How to reproduce:
git clone https://github.com/juniorgarcia/rollup-postcss-rebuild-error
npm install
npm run dev
src/index.js
anddist/bundle.css
and put them side by sidesrc/index.js
, uncomment// import './foo.css'
(here everything works as expected)// import './foo.css'
againbundle.css
is now generated wrongly:I started to realize this when using Linaria in my stack. After thinking that Linaria plugins was causing this, I tried the simplest stack possible without anything other than PostCSS plugin and the erro persists.
My rollup.config.js:
My package.json:
System information:
Node: v18.15.0
NPM: v9.6.2
OS: macOS Ventura 13.3.1 (a)
The text was updated successfully, but these errors were encountered: