forked from firka/flutter
[flutter_tools] fix package config invalidation (#55420)
This commit is contained in:
@@ -1270,6 +1270,17 @@ class ProjectFileInvalidator {
|
||||
if (updatedAt != null && updatedAt.isAfter(lastCompiled)) {
|
||||
invalidatedFiles.add(packageUri);
|
||||
packageConfig = await _createPackageConfig(packagesPath);
|
||||
// The frontend_server might be monitoring the package_config.json file,
|
||||
// Pub should always produce both files.
|
||||
// TODO(jonahwilliams): remove after https://github.com/flutter/flutter/issues/55249
|
||||
if (_fileSystem.path.basename(packagesPath) == '.packages') {
|
||||
final File packageConfigFile = _fileSystem.file(packagesPath)
|
||||
.parent.childDirectory('.dart_tool')
|
||||
.childFile('package_config.json');
|
||||
if (packageConfigFile.existsSync()) {
|
||||
invalidatedFiles.add(packageConfigFile.uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_logger.printTrace(
|
||||
|
||||
Reference in New Issue
Block a user