Skip to content

Commit

Permalink
Remove the source map comment from the JS blob we release (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 authored Aug 15, 2018
1 parent 3346c79 commit c5dff3e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
* Add a `SassException` type that provides information about Sass compilation
failures.

### JS API

* Remove the source map comment from the compiled JS. We don't ship with the
source map, so this pointed to nothing.

## 1.11.0

* Add support for importing plain CSS files. They can only be imported *without*
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: sass
version: 1.12.0-dev
version: 1.12.0
description: A Sass implementation in Dart.
author: Dart Team <[email protected]>
homepage: https://github.com/sass/dart-sass
Expand Down
7 changes: 7 additions & 0 deletions tool/grind/npm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ void _js({@required bool release}) {
Dart2js.compile(new File('bin/sass.dart'),
outFile: destination, extraArgs: args);
var text = destination.readAsStringSync();

if (release) {
// We don't ship the source map, so remove the source map comment.
text = text.replaceFirst(
new RegExp(r"\n*//# sourceMappingURL=[^\n]+\n*$"), "\n");
}

destination.writeAsStringSync(preamble.getPreamble() + text);
}

Expand Down

0 comments on commit c5dff3e

Please sign in to comment.