问题
I'm trying to set up several configurations in my Angular Dart project, to make it possible to serve and build different versions of Angular application from several different top level directories (apart from standard web directory)
For a demonstration I've created standard Angular Dart application from template ( https://github.com/vadimtsushko/two_configs_test ), and have copied web directory to web2.
I can successfully run application from web directory with pub run build_runner serve web:8080.
Now I add config file build.web2.yaml with such content:
targets:
$default:
builders:
build_web_compilers|entrypoint:
# These are globs for the entrypoints you want to compile.
generate_for:
- web2/**.dart
After that I run this new web2 configuration, hoping that would serve application from web2 directory with such command:
pub run build_runner serve --config=web2 web2:8080
But I get a warning:
[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
I definitely have source file ( main.dart ) in web2 directory. I've included web2 in a target in build.web2.yaml but apparently something is wrong with that config file.
What changes should I make in my build.web2.yaml file to make it work?
来源:https://stackoverflow.com/questions/55533382/how-to-serve-several-different-directories-in-angular-dart-project