Closed electrotype closed 1 year ago
Ha! I found it! It's not so trivial, maybe the documentation should talk about this?
The @import
directives need to be replaced with @use
. Also, you can't import an external package from "node_modules" as a module. You need to use a relative path to the ".css" distribution file!
So this worked for me:
src/test.scss
:
@use "./node_modules/animate.css/animate.css";
.someTest {
color: lime;
}
Hope it helps someone, one day.
With:
A
src/test.scss
file:A
src/test.ts
file that references the scss:My
rollup.config.mjs
file:This
.css
file is generated when runningrollup -c
:It doesn't bundle the "animate.css" content! When running the resulting files in a browser I get an error that the file "animate.css" is not found...
I did try another plugin "
rollup-plugin-sass
" and it bundled the@import
properly (but has other issues). I also did try with Webpack and "sass-loader
" and the content of the@import
was also bundled in the resulting.css
file.What am I missing in order for the
@import
to be bundled?