mirror of
https://github.com/danog/dart-sass.git
synced 2024-11-26 20:24:42 +01:00
Fix a check that prevents compiling .css files to themselves (#968)
Co-Authored-By: Natalie Weizenbaum <nweiz@google.com>
This commit is contained in:
parent
cf43f0d851
commit
4d78316cb7
@ -1,3 +1,8 @@
|
||||
## 1.26.3
|
||||
|
||||
* Fix a bug where `--watch` mode could go into an infinite loop compiling CSS
|
||||
files to themselves.
|
||||
|
||||
## 1.26.2
|
||||
|
||||
* More aggressively eliminate redundant selectors in the `selector.extend()` and
|
||||
|
@ -267,7 +267,7 @@ class _Watcher {
|
||||
p.setExtension(p.relative(source, from: sourceDir), '.css'));
|
||||
|
||||
// Don't compile ".css" files to their own locations.
|
||||
if (destination != source) return destination;
|
||||
if (!p.equals(destination, source)) return destination;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -1,5 +1,5 @@
|
||||
name: sass
|
||||
version: 1.26.2
|
||||
version: 1.26.3
|
||||
description: A Sass implementation in Dart.
|
||||
author: Sass Team
|
||||
homepage: https://github.com/sass/dart-sass
|
||||
|
@ -173,6 +173,34 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
]).validate();
|
||||
});
|
||||
|
||||
test(
|
||||
"when it's modified twice when watched from a directory that is "
|
||||
"also a destination", () async {
|
||||
await d.file("test.scss", "a {b: c}").create();
|
||||
|
||||
var sass = await watch(["."]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to test.css.'));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
await d.file("test.scss", "r {o: g}").create();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to test.css.'));
|
||||
|
||||
await tickIfPoll();
|
||||
|
||||
await d.file("test.scss", "x {y: z}").create();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to test.css.'));
|
||||
|
||||
await sass.kill();
|
||||
|
||||
await d
|
||||
.file("test.css", equalsIgnoringWhitespace("x { y: z; }"))
|
||||
.validate();
|
||||
});
|
||||
|
||||
group("when its dependency is modified", () {
|
||||
test("through @import", () async {
|
||||
await d.file("_other.scss", "a {b: c}").create();
|
||||
|
Loading…
Reference in New Issue
Block a user