如何忽略项目中的依赖关系?
我的项目设置是:
项目A:取决于 Angular2 和取决于基础
项目基础:取决于 Redstone_mapper_mongo
问题是我想在Project A中使用angular2,具体取决于我的Project Foundation。但是,项目基金会使用红石映射器mongo,但是angular2和红石映射器mongo不能一起工作。
问题:
所以在我的基础上是这样的。我可以忽略项目A中的@Field(),@ NotEmpty和导入吗?这样,在Project A中, Angular 操作就可以了吗? 因此,不应在Project A中加载红石映射器mongo。但是我该怎么做?
import 'package:redstone_mapper/mapper.dart';
class Address {
@Field()
@NotEmpty()
String street;
@Field()
@NotEmpty()
String city;
}
[更新]
我的项目A中现在有这些依赖项。我加了
code_transformers:^ 0.5.1
项目A pubspec.yaml
dependencies:
angular: "^4.0.0+2"
angular_forms: "^1.0.0"
foundation:
path: ../foundation
dependency_overrides:
code_transformers: ^0.5.1
dev_dependencies:
angular_test: ^1.0.0
browser: ^0.10.0
dart_to_js_script_rewriter: ^1.0.1
test: ^0.12.30
transformers:
- angular:
entry_points:
- web/main.dart
- test/**_test.dart
- test/pub_serve:
$include: test/**_test.dart
- dart_to_js_script_rewriter
基金会pubspec.yaml
dependencies:
intl: "^0.15.2"
http: "^0.11.3+16"
great_circle_distance: "^1.0.1"
redstone_mapper_mongo: "0.2.0-beta.1"
jaguar_serializer: "^0.5.1"
dev_dependencies:
browser: "^0.10.0+2"
dart_to_js_script_rewriter: "^1.0.3"
transformers:
- dart_to_js_script_rewriter
最佳答案
在Angular项目中添加
dependency_overrides:
code_transformers: ^0.5.1
analyzer: 0.30.0+4
应该修复它
关于dart - Dart 忽略依赖性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49129032/