| Index: sdk/lib/_internal/pub/lib/src/barback/watch_sources.dart
|
| diff --git a/sdk/lib/_internal/pub/lib/src/barback/watch_sources.dart b/sdk/lib/_internal/pub/lib/src/barback/watch_sources.dart
|
| index bc1c7ec8c582e6ecc9d8d17f67d9c798e35a0a4d..6a176aa5a8ab2d609fa3c990da2b06b1c45e3a92 100644
|
| --- a/sdk/lib/_internal/pub/lib/src/barback/watch_sources.dart
|
| +++ b/sdk/lib/_internal/pub/lib/src/barback/watch_sources.dart
|
| @@ -20,9 +20,20 @@ void watchSources(PackageGraph graph, Barback barback) {
|
| // Add the initial sources.
|
| barback.updateSources(_listAssets(graph.entrypoint, package));
|
|
|
| + // If this package comes from a cached source, its contents won't change so
|
| + // we don't need to monitor it. `packageId` will be null for the application
|
| + // package, since that's not locked.
|
| + var packageId = graph.lockFile.packages[package.name];
|
| + if (packageId != null &&
|
| + graph.entrypoint.cache.sources[packageId.source].shouldCache) {
|
| + continue;
|
| + }
|
| +
|
| // Watch the visible package directories for changes.
|
| for (var name in _getPublicDirectories(graph.entrypoint, package)) {
|
| var subdirectory = path.join(package.dir, name);
|
| + if (!dirExists(subdirectory)) continue;
|
| +
|
| // TODO(nweiz): close these watchers when [barback] is closed.
|
| var watcher = new DirectoryWatcher(subdirectory);
|
| watcher.events.listen((event) {
|
|
|