如何在Angular Dart项目中服务几个不同的目录?

时间:2019-04-05 10:26:40

标签: dart angular-dart

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

0 个答案:

没有答案