使用Angular CLI v6生成空工作区可行吗?可含默认projects文件夹内的初始应用
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 (likeangular.json,package.json) without any app code yet:ng new my-workspace --createApplication=falseReplace
my-workspacewith your preferred workspace name.Add your initial application to the projects folder
Navigate into your new workspace directory:cd my-workspaceThen generate your first application—this will automatically place all the app's files inside the projects folder:
ng generate app my-appSwap
my-appwith 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

