Angular-cli: ng build doesn't generate app shell

Created on 6 Jul 2018  路  8Comments  路  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

- [x] bug report 
- [ ] feature request

Area

- [x] devkit
- [x] schematics

Versions

Angular CLI: 6.0.8
Node: 8.11.2
OS: win32 x64
Angular: 6.0.7
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.8
@angular-devkit/build-angular     0.6.8
@angular-devkit/build-optimizer   0.6.8
@angular-devkit/core              0.6.8
@angular-devkit/schematics        0.6.8
@angular/cli                      6.0.8
@ngtools/webpack                  6.0.8
@schematics/angular               0.6.8
@schematics/update                0.6.8
rxjs                              6.2.1
typescript                        2.7.2
webpack                           4.8.3

Repro steps

  1. Create a new project with routing ng new app-shell-test --routing
  2. Add app shell to project ng g app-shell --universal-project=app-shell-test --client-project=app-shell-test
  3. Build project with ng build or ng build --prod

Actual

The app shell is not generated.

Mention any other details that might be useful

I'm trying to add the app shell to my app, but ng build not want to generate it. The shell generates only after ng run app-shell-test:app-shell. Is this a valid behavior or a bug? (in the first case the --skip-app-shell is unused...)

devkibuild-angular low confusing bufix

Most helpful comment

@JimDrury you can use ng-run my-app:app-shell -c production if you generated the app-shell with the CLI to have a production build with app-shell enabled. This also works together with Angular Universal+Angular Service Worker, something I also initially struggled with.

All 8 comments

This is the intended behavior, yes. It is documented in https://github.com/angular/angular-cli/wiki/stories-app-shell.

@filipesilva,

  1. on linked page I don't see anything about ng build
  2. ng build have the --skip-app-shell and this option worked prior to 6.0, see https://github.com/angular/angular-cli/wiki/build BUT this option fully ignored now => shell will never be generated during ng build
  3. if this is "intended behavior" and app shell not generating during ng build

    • how can I use app with generated app shell in production? Build and shell will generate the different hashes, right? so the shell seems is unuseful...

    • why --skip-app-shell still here?

There isn't anything there about ng build because the way you build the app shell is via ng run my-app:app-shell. You'll find your built project in the dist directory, with the app shell inside index.html.

--skip-app-shell shouldn't be there anymore though. That option should error out. I'll reopen so someone can remove that option from the allowed list.

--skip-app-shell shouldn't be there anymore though.

Ok, thank you :)

So i'm confused, ng build doesn't generate the app shell and ng run my-app:app-shell doesn't generate the service worker. How do you build a pwa with an app shell?

Also running ng-run my-app:app-shell doesnt build optimised files. Basic vendorJS greater than 3mb.

@JimDrury you can use ng-run my-app:app-shell -c production if you generated the app-shell with the CLI to have a production build with app-shell enabled. This also works together with Angular Universal+Angular Service Worker, something I also initially struggled with.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JanStureNielsen picture JanStureNielsen  路  3Comments

NCC1701M picture NCC1701M  路  3Comments

gotschmarcel picture gotschmarcel  路  3Comments

sysmat picture sysmat  路  3Comments

IngvarKofoed picture IngvarKofoed  路  3Comments