dart - 如何在 Angular Dart 项目中提供多个不同的目录?
问题描述
我正在尝试在我的 Angular Dart 项目中设置几个配置,以便可以从几个不同的顶级目录(标准web
目录除外)提供和构建不同版本的 Angular 应用程序。为了演示,我创建了标准 Angular Dart来自模板(https://github.com/vadimtsushko/two_configs_test)的应用程序,并将web
目录复制到web2
. 我可以web
使用pub run build_runner serve web:8080
. 现在我添加build.web2.yaml
具有此类内容的配置文件:
targets:
$default:
builders:
build_web_compilers|entrypoint:
# These are globs for the entrypoints you want to compile.
generate_for:
- web2/**.dart
之后,我运行这个新web2
配置,希望能够web2
使用这样的命令从目录中为应用程序提供服务:
pub run build_runner serve --config=web2 web2:8080
但我收到一个警告:
[WARNING] Requested a server for `web2` but this directory has no assets in the build. You may need to add some sources or include this directory in some target in your `build.yaml`
Serving `web2` on http://localhost:8080
我在目录中肯定有源文件( main.dart
) 。web2
我已经包含web2
在一个目标中,build.web2.yaml
但显然该配置文件有问题。
我应该在我的build.web2.yaml
文件中进行哪些更改才能使其正常工作?
解决方案
推荐阅读
- reactjs - 移动 Draggable 时,列表顶部会出现很大的间隙,并且会奇怪地移动所有内容(React Beautiful DND)
- android - 使用光标时出现空指针异常
- html - 下拉菜单不是 100% 可见
- python - 如何更改函数内部变量的值以及调用函数时要返回的值?
- android - 没有为“JitsiMeetingOptions”类型定义设置器“featureFlag”
- python-3.x - Pandas:对于特定日期内另一个 df 中出现的每一行计数
- regex - 在unix脚本中搜索并用多行替换一行
- button - 如何通过在 PyQt5 中拖动来交换 2 个按钮的位置
- java - java Date format convert 'M/d/yyyy' to 'yyyy-MM-dd'T'HH:mm:ss.SSSXXX' like 2021-04-05T00:00-07:00[UTC-07:00]
- json - 使用 retforit 从嵌套的 json 扩展 API 中提取数据