我正在尝试在Angular Dart项目中设置几种配置,以便可以从几个不同的顶级目录(标准web
目录除外)中服务和构建Angular应用程序的不同版本
为了演示,我已经从模板(https://github.com/vadimtsushko/two_configs_test)创建了标准的Angular Dart应用程序,并将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
文件中进行哪些更改以使其起作用?