Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sass-loader ignores import-only files #788

jathak opened this issue Jan 3, 2020 · 1 comment

sass-loader ignores import-only files #788

jathak opened this issue Jan 3, 2020 · 1 comment


Copy link

@jathak jathak commented Jan 3, 2020

  • Operating System: Debian Stretch
  • Node Version: 13.5.0
  • NPM Version: 6.13.4
  • webpack Version: 4.41.5
  • sass-loader Version: 8.0.0
  • Sass version: Dart Sass 1.24.1

Expected Behavior

@import rules should load the import-only file if one exists, instead of the regular file (as is the case for @use and @forward rules).

This behavior is necessary to allow for incremental migration to the Sass module system, as libraries use import-only files to preserve manual member prefixes for @import users while removing them for users who migrate to the module system.

Actual Behavior

@import rules always load the regular file, even if an import-only file exists. The code below works with Dart Sass on its own, but errors when run through sass-loader.


// style.scss
@import "dependency";

a {
  color: $dep-color;

// _dependency.scss
$color: blue;

// _dependency.import.scss
@forward "dependency" as dep-*;

This comment has been minimized.

Copy link

@jathak jathak commented Jan 3, 2020

Upon further investigation, it looks like this is actually a bug in Sass itself, so closing this issue

@jathak jathak closed this Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.