Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(13);
sourceMap.sources.should.have.length(12);
sourceMap.sources.forEach(sourcePath =>
fs.existsSync(path.resolve(sourceMap.sourceRoot, sourcePath))
);
Expand Down
3 changes: 3 additions & 0 deletions test/node_modules/another/package.json

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

File renamed without changes.
3 changes: 3 additions & 0 deletions test/node_modules/module/package.json

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

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

This file was deleted.

5 changes: 3 additions & 2 deletions test/sass/imports.sass
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
/* scoped import @import language */
.scoped-imporr
@import language

// 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
/* @import ~another */
@import ~another
6 changes: 2 additions & 4 deletions test/scss/imports.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* @import "another/module"; */
@import "another/module";
/* @import "~another/module"; */
@import "~another/module";
/* @import "another/underscore"; */
@import "another/underscore";
/* @import "another/_underscore"; */
Expand All @@ -27,5 +25,5 @@
@import "util";
/* @import "~module"; */
@import "~module";
/* @import "~other-module"; */
@import "~other-module";
/* @import "~another"; */
@import "~another";
4 changes: 4 additions & 0 deletions test/tools/createSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ function createSpec(ext) {
const testNodeModules = path.relative(basePath, path.join(testFolder, "node_modules")) + path.sep;
const pathToBootstrap = path.relative(basePath, path.resolve(testFolder, "..", "node_modules", "bootstrap-sass"));
const pathToScopedNpmPkg = path.relative(basePath, path.resolve(testFolder, "node_modules", "@org", "pkg", "./index.scss"));
const pathToModule = path.relative(basePath, path.resolve(testFolder, "node_modules", "module", "module.scss"));
const pathToAnother = path.relative(basePath, path.resolve(testFolder, "node_modules", "another", "module.scss"));
const pathToFooAlias = path.relative(basePath, path.resolve(testFolder, ext, "another", "alias." + ext));

fs.readdirSync(path.join(testFolder, ext))
Expand All @@ -33,6 +35,8 @@ function createSpec(ext) {
url = url
.replace(/^~bootstrap-sass/, pathToBootstrap)
.replace(/^~@org\/pkg/, pathToScopedNpmPkg)
.replace(/^~module/, pathToModule)
.replace(/^~another/, pathToAnother)
.replace(/^~/, testNodeModules)
.replace(/^path-to-alias/, pathToFooAlias);
}
Expand Down