Skip to content

Scripts: Don't use sass-loader on .css files #22733

Closed
@ocean90

Description

Description

This is a follow-up for #21730. The config added a catch-all rule for \.(sc|sa|c)ss$ with the sass-loader as the last loader.

{
loader: require.resolve( 'sass-loader' ),
options: {
sourceMap: ! isProduction,
},
},

This means the sass-loader is also used on plain .css files. While not bad it's kind of unexpected and may cause double processing a file which was already processed by a broader postcss-config, see example from #22732.

I'm suggesting to use a custom rule for .scss files which should allow us to make node-sass/sass/sass-loader a peer dependency. #22729 would be related to that.

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions