Skip to content

Commit 0063b40

Browse files
committed
Normalize paths for windows
Fixes webpack-contrib#137
1 parent a4af493 commit 0063b40

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ module.exports = function (content) {
4343
if (err.file === 'stdin') {
4444
err.file = resourcePath;
4545
}
46+
// node-sass returns UNIX-style paths
47+
err.file = path.normalize(err.file);
4648

4749
// The 'Current dir' hint of node-sass does not help us, we're providing
4850
// additional information by reading the err.file property
@@ -157,7 +159,12 @@ module.exports = function (content) {
157159
// When files have been imported via the includePaths-option, these files need to be
158160
// introduced to webpack in order to make them watchable.
159161
function addIncludedFilesToWebpack(includedFiles) {
160-
includedFiles.forEach(self.dependency);
162+
includedFiles.forEach(addNormalizedDependency);
163+
}
164+
165+
function addNormalizedDependency(file) {
166+
// node-sass returns UNIX-style paths
167+
self.dependency(path.normalize(file));
161168
}
162169

163170
this.cacheable();

0 commit comments

Comments
 (0)