Joyce Babu
Joyce Babu

Reputation: 20674

Compile individual SCSS files with rollup.js

I have multiple css files under a directory named src/assets/scss. I want to compile the files to similarly named css files under dist/assets/css. For example, src/assets/scss/a.scss should be compiled to dist/assets/css/a.css and src/assets/scss/b.scss should be compiled to dist/assets/css/b.css.

How can I do this with rollup?

Upvotes: 1

Views: 536

Answers (1)

Simplicius
Simplicius

Reputation: 2095

You don't need rollup. Sass already comes with a feature to allow for exactly this. As you may know Sass file which start with an underscore are not individually compiled, e.g. _functions.scss or _mixins.scss will only be compiled if they are first imported into a file not starting with an underscore. But if you create a folder called sass, all files that are supposed to be compiled will automaticaly compile into individular file inside a folder called css.

enter image description here

enter image description here

Upvotes: 1

Related Questions