Anidetrix / rollup-plugin-styles

🎨 Universal Rollup plugin for styles: PostCSS, Sass, Less, Stylus and more.
https://anidetrix.github.io/rollup-plugin-styles
MIT License
246 stars 43 forks source link

Prevent to add hash to referenced files inside CSS #223

Open stefanobartoletti opened 2 years ago

stefanobartoletti commented 2 years ago

I'm trying to correclty import a SVG inside a CSS file, this is what I'm doing in my source file:

ul {
  list-style-image: url('../img/check.svg');
}

and this is what I get as a output:

ul {
  list-style-image: url("./check-0ecf99f0.svg");
}

I need to reference the file without the hash, just by its simple name check.svg, how can I correctly do so?

j5bot commented 2 years ago

I think you would use a function in rollup's assetFileNames output option: https://rollupjs.org/guide/en/#outputassetfilenames