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

Normalize paths of dependencies #141

Merged
merged 2 commits into from
Aug 14, 2015
Merged
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
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ module.exports = function (content) {
resolvedFilename = self.resolveSync(dirContext, importToResolve);
// Add the resolvedFilename as dependency. Although we're also using stats.includedFiles, this might come
// in handy when an error occurs. In this case, we don't get stats.includedFiles from node-sass.
self.dependency(resolvedFilename);
addNormalizedDependency(resolvedFilename);
// By removing the CSS file extension, we trigger node-sass to include the CSS file instead of just linking it.
resolvedFilename = resolvedFilename.replace(matchCss, '');
return {
Expand Down Expand Up @@ -160,7 +160,7 @@ module.exports = function (content) {
}
// Add the resolvedFilename as dependency. Although we're also using stats.includedFiles, this might come
// in handy when an error occurs. In this case, we don't get stats.includedFiles from node-sass.
self.dependency(resolvedFilename);
addNormalizedDependency(resolvedFilename);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

webpack returns normalized paths afaik

// By removing the CSS file extension, we trigger node-sass to include the CSS file instead of just linking it.
resolvedFilename = resolvedFilename.replace(matchCss, '');

Expand Down Expand Up @@ -237,15 +237,15 @@ module.exports = function (content) {
return result.css.toString();
} catch (err) {
formatSassError(err);
err.file && this.dependency(err.file);
err.file && addNormalizedDependency(err.file);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that this is necessary. formatSassError is already normalizing it.

throw err;
}
}

asyncSassJobQueue.push(opt, function onRender(err, result) {
if (err) {
formatSassError(err);
err.file && self.dependency(err.file);
err.file && addNormalizedDependency(err.file);
callback(err);
return;
}
Expand Down