Skip to content

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

Closed

Description

@ocean90

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.

Activity

  1. added
    [Type] Enhancement
    [Type] Build Tooling
    [Tool] WP Scripts
    on May 29, 2020
  2. added
    [Status] In Progress
    on Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Status] In Progress[Tool] WP Scripts[Type] Build Tooling[Type] Enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions