You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Angular CLI v6生成空工作区可行吗?可含默认projects文件夹内的初始应用

Can Angular CLI v6 generate an empty workspace with an initial app in the default projects folder?

Yes, definitely! Angular CLI v6 introduced the workspace-based structure, and setting this up is straightforward. Here's how to do it:

  • First, create an empty workspace
    Run this command to generate a workspace without any pre-built application. This gives you the core workspace config files (like angular.json, package.json) without any app code yet:

    ng new my-workspace --createApplication=false
    

    Replace my-workspace with your preferred workspace name.

  • Add your initial application to the projects folder
    Navigate into your new workspace directory:

    cd my-workspace
    

    Then generate your first application—this will automatically place all the app's files inside the projects folder:

    ng generate app my-app
    

    Swap my-app with whatever name you want for your app.

After these steps, your workspace will have the projects/my-app directory housing all your application code, while the root folder holds shared configuration and workspace-level dependencies. You can confirm this by checking the angular.json file—your app will be listed under the projects section, with its path pointing to projects/my-app.

内容的提问来源于stack exchange,提问作者Anton Moiseev

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 03:56:34