# test-projects **Repository Path**: dq07-test/test-projects ## Basic Information - **Project Name**: test-projects - **Description**: angular projects - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-11-04 - **Last Updated**: 2026-02-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # angular多项目结构 ### 创建父项目 ```bash ng new test-projects ``` ### 创建子项目 ```bash cd test-projects ng g application home ng g application list ng g application detail ``` 创建了home、list、detail三个子项目 ### 运行子项目 ```bash ng serve home --port 4201 ng serve list --port 4202 ng serve detail --port 4203 ``` 在三个端口上分别启动了三个子项目 ### 打包 ```bash ng build home --prod ng build list --prod ng build detail --prod ``` 输出路径分别为: ``` dist/home dist/list dist/detail ``` ### 其它说明 - angular.json文件结构 ![](img/1.png) - package.json只存在于父项目中,子项目中没有此文件。 - 依赖包安装一次所有项目均可引用。 - 引用了依赖才会打到最终的包里,没引用的依赖不会增加包的体积。