thgh / rollup-plugin-scss

Rollup and compile multiple .scss, .sass and .css imports
MIT License
134 stars 47 forks source link

How to skip imported scss called inside my input file? #100

Closed bluezald closed 1 year ago

bluezald commented 1 year ago

Hi, is it possible to skip building of dependent scss?

For example I have my own scss called styles.scss with a following dependency from node modules:

styles.scss

@import "@/../node_modules/third_party.scss";

// my scss here

In my rollup, I have set:

scss({
    processor: () => postcss([autoprefixer()]),
    exclude: [path.join(__dirname, '../node_modules/'), 'node_modules/'],
    output: 'dist/styles.scss',
    failOnError: true,
    runtime: require('sass')
 })

But once the build is done, The font faces from the third-party scss is included, and I wanted to skip that. I'm only using the imported scss for the variables and colors.

thgh commented 1 year ago

The third party should create a separate file for the colors & variables so you can import that file specifically.

bluezald commented 1 year ago

Thanks @thgh That fixed it, and also I seem to have imported in another file the scss, that is why, I'm getting a lot of font faces.