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?
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.
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 .
Inside the src folder, the app folder contains your project's logic and data. Angular components, templates, and styles go here.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With