简体   繁体   中英

How Angular dist folder(After build) works with multiple projects

I am creating angular project, to optimize build time I am split the application into 3 applications, App1, App2 and App3. To test in my local after building 3 projects individually I am coping the App2 and App3 main.js files into App1(dist/app1_main/main.js and dist/app2_main/main.js). How can I write routing in App1 to load a component which is in App2 and App3.

It seems you are looking for a more robust Angular architecture. You can achieve this utilizing a multi-project workspace where you can create libraries that share components between applications, and also you can create common services. Please take a look at https://angular.io/guide/file-structure#multiple-projects

Here is great documentation about this architecture https://octoperf.com/blog/2019/08/22/kraken-angular-workspace-multi-application-project/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM