Skip to content

Commit 8654e5c

Browse files
docs: update contribution docs for serving a local library/project (#47421)
PR Close #47421
1 parent ad098d8 commit 8654e5c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/DEVELOPER.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,24 @@ This can be done by running:
100100
yarn ng-dev misc build-and-link <path-to-local-project-root>
101101
```
102102

103+
### Building and serving a project
104+
105+
#### Cache
106+
107+
When making changes to Angular packages and testing in a local library/project you need to run `ng cache disable` to disable the Angular CLI disk cache. If you are making changes that are not reflected in your locally served library/project, verify if you have [CLI Cache](https://angular.io/guide/workspace-config#cache-options) disabled.
108+
109+
#### Invoking the Angular CLI
110+
111+
The Angular CLI needs to be invoked using Node.js [`--preserve-symlinks`](https://nodejs.org/api/cli.html#--preserve-symlinks) flag. Otherwise the symbolic links will be resolved using their real path which causes node module resolution to fail.
112+
113+
##### Windows
114+
115+
`set BAZEL_TARGET="1" && node --preserve-symlinks node_modules/@angular/cli/lib/init.js serve`
116+
117+
##### Unix Systems
118+
119+
`BAZEL_TARGET="1" node --preserve-symlinks node_modules/.bin/ng serve`
120+
103121
## Formatting your source code
104122

105123
Angular uses [clang-format](https://clang.llvm.org/docs/ClangFormat.html) to format the source code.

0 commit comments

Comments
 (0)