9

In my cli-generated workspace I have the root-application which lazy loads numerous application (sitting in the projects folder).

When I run "ng build root-application", all the chunks are placed in the dist/root-application folder, and I could copy this folder across to my server, and we're good to go.

However, these applications are almost never at the same stage in their development life-cycle (still in development, some being QA'd), and I want to de able to deploy them in isolation, rather than having to deploy the whole site.

Does anyone have a strategy for this?

blomster
  • 768
  • 2
  • 10
  • 27

2 Answers2

3

Ok Doing All this work manually will be a cumbersome process, there are tools which can help automate this work. Nx (nrwl.io) can help you solve your problem, it uses a Monorepo approach where you can build multiple angular/react application/libraries in one workspace, all this application can be independent of each other. To get started click here. To read about why to use Nx click here. Nx has been designed by Victor Savkin (Core Angular Team Member who has designed lots of features for angular)

Akshay Rajput
  • 1,978
  • 1
  • 12
  • 22
  • 2
    I can't emphasise enough just how good the Nx toolset is - anybody working on enterprise Angular projects should check it out. The affected:xxx scripts they provide are truly next-level from a devops perspective for managing complex multi app/library ecosystems. – hevans900 May 28 '19 at 09:03
-1

So, my solution in the end was the create libraries (ng generate library) instead of applications (ng generate application). I could then individually publish my libraries to NPM. I could then deploy my whole site, but by only upgrading the desired library in my package.json file, I was able to 'deploy' the desired part of the site in isolation.

blomster
  • 768
  • 2
  • 10
  • 27