You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/documentation/stories/create-library.md
+14-19Lines changed: 14 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -78,29 +78,24 @@ directory for the library beforehand, removing old code leftover code from previ
78
78
## Why do I need to build the library everytime I make changes?
79
79
80
80
Running `ng build my-lib` every time you change a file is bothersome and takes time.
81
+
In `Angular CLI` version `6.2` an incremental builds functionality has been added to improve the experience of library developers.
82
+
Everytime a file is changed a partial build is performed that emits the amended files.
81
83
82
-
Some similar setups instead add the path to the source code directly inside tsconfig.
83
-
This makes seeing changes in your app faster.
84
+
The feature can be using by passing `--watch` command argument as show below;
84
85
85
-
But doing that is risky.
86
-
When you do that, the build system for your app is building the library as well.
87
-
But your library is built using a different build system than your app.
88
-
89
-
Those two build systems can build things slightly different, or support completely different
90
-
features.
91
-
92
-
This leads to subtle bugs where your published library behaves differently from the one in your
93
-
development setup.
94
-
95
-
For this reason we decided to err on the side of caution, and make the recommended usage
96
-
the safe one.
97
-
98
-
In the future we want to add watch support to building libraries so it is faster to see changes.
86
+
```bash
87
+
ng build my-lib --watch
88
+
```
99
89
100
-
We are also planning to add internal dependency support to Angular CLI.
101
-
This means that Angular CLI would know your app depends on your library, and automatically rebuilds
102
-
the library when the app needs it.
90
+
Note: This feature requires that Angular's Compiler Option [enableResourceInlining](https://angular.io/guide/aot-compiler#enableresourceinlining) is enabled.
91
+
This can be done by adding the below in your `tsconfig.lib.json`.
0 commit comments