Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 7 - deploy workspace applications (projects) in isolation

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?

like image 866
blomster Avatar asked May 17 '19 06:05

blomster


People also ask

How do I bundle an angular app for production?

The ng build command compiles the app into an external output folder dist/. This command is to be executed within the working directory. The above picture shows the structure of the folder of the dist folder. The application builder in Angular uses a webpack build tool that configures the workspace configuration file.

How is Angular application deployed?

Basic deployment to a remote serverlink For the simplest deployment, create a production build and copy the output directory to a web server. Copy everything within the output folder ( dist/project-name/ by default) to a folder on the server. Configure the server to redirect requests for missing files to index.html .

Where are Angular projects stored?

Inside the src folder, the app folder contains your project's logic and data. Angular components, templates, and styles go here.


1 Answers

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)

like image 183
Akshay Rajput Avatar answered Nov 15 '22 22:11

Akshay Rajput