Skip to content

Commit

Permalink
fix: Bare imports not working sometimes
Browse files Browse the repository at this point in the history
Fixes #566
Supersedes #577
  • Loading branch information
jhnns committed Jun 4, 2018
1 parent 2efb8cf commit 745e241
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ describe("sass-loader", () => {
sourceMap.should.not.have.property("file");
sourceMap.should.have.property("sourceRoot", fakeCwd);
// This number needs to be updated if imports.scss or any dependency of that changes
sourceMap.sources.should.have.length(11);
sourceMap.sources.should.have.length(13);
sourceMap.sources.forEach(sourcePath =>
fs.existsSync(path.resolve(sourceMap.sourceRoot, sourcePath))
);
Expand Down
3 changes: 3 additions & 0 deletions test/node_modules/module

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions test/node_modules/other-module

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions test/sass/imports.sass
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@
// See https://github.com/webpack-contrib/sass-loader/issues/556
/* @import util */
@import util
/* @import ~module */
@import ~module
/* @import ~other-module */
@import ~other-module
5 changes: 5 additions & 0 deletions test/scss/imports.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,9 @@
}
// The local util file should take precedence over Node's util module
// See https://github.com/webpack-contrib/sass-loader/issues/556
/* @import "util"; */
@import "util";
/* @import "~module"; */
@import "~module";
/* @import "~other-module"; */
@import "~other-module";

0 comments on commit 745e241

Please sign in to comment.