Skip to content

Commit

Permalink
Fix source map path canonicalization
Browse files Browse the repository at this point in the history
We need to canonicalize rather than normalize to ensure a consistent
output.
  • Loading branch information
nex3 committed May 24, 2018
1 parent c2987d4 commit a711882
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/src/executable_options.dart
Expand Up @@ -288,7 +288,7 @@ class ExecutableOptions {
/// Makes [url] absolute or relative (to the directory containing
/// [destination]) according to the `source-map-urls` option.
Uri sourceMapUrl(Uri url, String destination) {
var path = p.normalize(p.fromUri(url));
var path = p.canonicalize(p.fromUri(url));
return p.toUri(_options['source-map-urls'] == 'relative'
? p.relative(path, from: p.dirname(destination))
: p.absolute(path));
Expand Down
4 changes: 2 additions & 2 deletions test/cli_shared.dart
Expand Up @@ -523,9 +523,9 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
_readJson("out.css.map"),
containsPair("sources", [
p
.toUri(p.normalize(p.join(d.sandbox, "dir/other.scss")))
.toUri(p.canonicalize(p.join(d.sandbox, "dir/other.scss")))
.toString(),
p.toUri(p.normalize(p.join(d.sandbox, "test.scss"))).toString()
p.toUri(p.canonicalize(p.join(d.sandbox, "test.scss"))).toString()
]));
});

Expand Down

0 comments on commit a711882

Please sign in to comment.