Skip to content

Commit

Permalink
Do not warn about missing unused css selectors if both css and emitCs…
Browse files Browse the repository at this point in the history
…s are false (#127)
  • Loading branch information
mustafa0x authored Oct 6, 2020
1 parent f7e5eec commit 3a0c4a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ module.exports = function svelte(options = {}) {
if (major_version >= 3) warnings = compiled.warnings || compiled.stats.warnings;

warnings.forEach(warning => {
if ((options.css || !options.emitCss) && warning.code === 'css-unused-selector') return;
if ((!options.css && !options.emitCss) && warning.code === 'css-unused-selector') return;

if (options.onwarn) {
options.onwarn(warning, warning => this.warn(warning));
Expand Down

1 comment on commit 3a0c4a7

@HendrikRunte
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After having updated from 6.0.0 to 6.0.1 I'm getting numerous warnings about unused selectors when working with scss:prependData('@import…') inside my rollup.config.js. I traced it down to this change. When changing this manually inside /node_modules everything works again. If I understand line 268 correctly, the condition has changed from:
if we have options.css OR options.emitCss is false or unset …
to
if we options.css is false or unset AND options.emitCss is false or unset …
Is this the desired behaviour?

Please sign in to comment.