✨ This workspace has been generated by Nx, Smart Monorepos · Fast CI. ✨
Enhance your Nx experience by installing Nx Console for your favorite editor. Nx Console provides an interactive UI to view your projects, run tasks, generate code, and more! Available for VSCode, IntelliJ and comes with a LSP for Vim users.
Run npx nx serve app-shell to start the development server. Happy coding!
Run npx nx build app-shell to build the application. The build artifacts are stored in the output directory (e.g. dist/ or build/), ready to be deployed.
To execute tasks with Nx use the following syntax:
npx nx <target> <project> <...options>
You can also run multiple targets:
npx nx run-many -t <target1> <target2>
..or add -p to filter specific projects
npx nx run-many -t <target1> <target2> -p <proj1> <proj2>
Targets can be defined in the package.json or projects.json. Learn more in the docs.
Nx comes with local caching already built-in (check your nx.json). On CI you might want to go a step further.
Run npx nx graph to show the graph of the workspace.
It will show tasks that you can run with Nx.
Following this article:
npx nx generate @nrwl/angular:app apps/app-shell --style=scss --routing=true --e2eTestRunner=cypress --bundler=webpack --ssr=falseRun "nx show project app-shell" to view details about this project.
nx run app-shell:servenpx nx generate @nrwl/angular:app apps/app-one --style=scss --routing=true --e2eTestRunner=cypress --bundler=webpack --ssr=false;npx nx generate @nrwl/angular:app apps/app-two --style=scss --routing=true --e2eTestRunner=cypress --bundler=webpack --ssr=falseThis will create app-one and app-two
npx nx generate @nrwl/angular:lib ui --directory=libs/ui;npx nx generate @nrwl/angular:component ui-button --directory=libs/ui/src/lib/ui-button --export;npx nx generate @nrwl/angular:component ui-label --directory=libs/ui/src/lib/ui-label --exportAccept the default options.
Add aliases for apps to paths in tsconfig.base.json.
"@angular-mfe-nx/app-two/*": ["apps/app-two/src/app/*"],
"@angular-mfe-nx/ui": ["libs/ui/src/index.ts"]
Note: ESLint error needs override:
export const appRoutes: Route[] = [
{
path: 'app-one',
// eslint-disable-next-line @nx/enforce-module-boundaries
loadComponent: () => import('@angular-mfe-nx/app-one/app.component').then(m => m.AppComponent)
},
{
path: 'app-two',
// eslint-disable-next-line @nx/enforce-module-boundaries
loadComponent: () => import('@angular-mfe-nx/app-two/app.component').then(m => m.AppComponent)
},
];Change apps/app-shell/src/app/app.component.html
<h1>App Shell</h1>
<router-outlet></router-outlet>Change the HTML in the other two apps.
Include the new UI Components.