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

Closed
jathak opened this issue Jan 3, 2020 · 1 comment
Closed

sass-loader ignores import-only files #788

jathak opened this issue Jan 3, 2020 · 1 comment

Comments

@jathak
Copy link

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.

Code

// style.scss
@import "dependency";

a {
  color: $dep-color;
}

// _dependency.scss
$color: blue;

// _dependency.import.scss
@forward "dependency" as dep-*;
@jathak
Copy link
Author

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 as completed Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant