Skip to content

Commit

Permalink
Remove sourcemap comments from Sass sources (#1860)
Browse files Browse the repository at this point in the history
* Remove sourcemap comments from Sass sources

* add changelog

* update version to cut a release and update sass_api changelog and pubspec
  • Loading branch information
Goodwine authored Jan 5, 2023
1 parent 441be80 commit aceb1e8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.57.2

* Remove sourcemap comments from Sass sources. The generated sourcemap comment
for the compiled CSS output remains unaffected.

## 1.57.1

* No user-visible changes.
Expand Down
3 changes: 3 additions & 0 deletions lib/src/visitor/serialize.dart
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ class _SerializeVisitor
// Preserve comments that start with `/*!`.
if (_isCompressed && !node.isPreserved) return;

// Ignore sourceMappingURL and sourceURL comments.
if (node.text.startsWith(RegExp(r"/\*# source(Mapping)?URL="))) return;

var minimumIndentation = _minimumIndentation(node.text);
assert(minimumIndentation != -1);
if (minimumIndentation == null) {
Expand Down
4 changes: 4 additions & 0 deletions pkg/sass_api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 4.2.2

* No user-visible changes.

## 4.2.1

* No user-visible changes.
Expand Down
4 changes: 2 additions & 2 deletions pkg/sass_api/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ name: sass_api
# Note: Every time we add a new Sass AST node, we need to bump the *major*
# version because it's a breaking change for anyone who's implementing the
# visitor interface(s).
version: 4.2.1
version: 4.2.2
description: Additional APIs for Dart Sass.
homepage: https://github.com/sass/dart-sass

environment:
sdk: ">=2.17.0 <3.0.0"

dependencies:
sass: 1.57.1
sass: 1.57.2

dev_dependencies:
dartdoc: ^5.0.0
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.57.1
version: 1.57.2
description: A Sass implementation in Dart.
homepage: https://github.com/sass/dart-sass

Expand Down

0 comments on commit aceb1e8

Please sign in to comment.