Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
* Fix a bug where `@extend` rules loaded through a mixture of `@import` and
`@use` rules could fail to apply correctly.

### Command-Line Interface

* In `--watch` mode, delete the source map when the associated source file is
deleted.

## 1.91.0

* **Potentially breaking change:** `meta.inspect()` (as well as other systems
Expand Down
5 changes: 4 additions & 1 deletion lib/src/executable/watch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ final class _Watcher {
var url = _canonicalize(path);

if (_graph.nodes.containsKey(url)) {
if (_destinationFor(path) case var destination?) _delete(destination);
if (_destinationFor(path) case var destination?) {
_delete(destination);
_delete("$destination.map");
}
}

var downstream = _graph.remove(FilesystemImporter.cwd, url);
Expand Down
2 changes: 1 addition & 1 deletion pkg/sass_api/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
sdk: ">=3.6.0 <4.0.0"

dependencies:
sass: 1.91.1
sass: 1.91.1-dev

dev_dependencies:
dartdoc: ^8.0.14
Expand Down
23 changes: 23 additions & 0 deletions test/cli/shared/watch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,29 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {

await d.dir("dir", [d.nothing("out.css")]).validate();
});

test("and deletes the source map", () async {
await d.file("test.scss", "a {b: c}").create();

var sass = await watch(["--source-map", "test.scss:out.css"]);
await expectLater(
sass.stdout,
emits(endsWith('Compiled test.scss to out.css.')),
);
await expectLater(sass.stdout, _watchingForChanges);
await tickIfPoll();

d.file("test.scss").io.deleteSync();
await expectLater(
sass.stdout,
emitsInOrder([
'Deleted out.css.',
'Deleted out.css.map.',
]));
await sass.kill();

await d.nothing("out.css").validate();
});
});

test("creates a new CSS file when a Sass file is added", () async {
Expand Down
Loading