Skip to content

Allow custom mainFields and extensions for getResolve #653

@deAtog

Description

@deAtog
  • Operating System: All
  • Node Version: n/a
  • NPM Version: n/a
  • webpack Version: 4.27.0+
  • sass-loader Version: trunk

Feature Proposal

The sass-loader plugin should allow the user to customize the mainFields and extensions used to resolve imports. The current defaults shown below may be insufficient for all use cases:

mainFields: ['sass', 'main'],
extensions: ['.scss', '.sass', '.css'],

E.g. 'style' is not included in mainFields by default.

Feature Use Case

CSS imports may be specified by other properties in the package.json file and may have additional extensions. The plugin should allow the user to specify these settings in order to support other package.json property names and additional file extensions.

E.g. @fortawesome/fontawesome-free has a package.json file which lacks a 'sass' property, but contains a 'style' property. Due to the current non-modifiable defaults in this plugin, users must continue to use the full path in the @import statement.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions