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: packages/@ngtools/webpack/README.md
+31-4Lines changed: 31 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,35 @@
3
3
Webpack plugin that AoT compiles your Angular components and modules.
4
4
5
5
## Usage
6
-
In your webpack config, add the following plugin and loader:
6
+
7
+
In your webpack config, add the following plugin and loader.
8
+
9
+
Angular version 5 and up, use `AngularCompilerPlugin`:
10
+
11
+
```typescript
12
+
import {AotPlugin} from'@ngtools/webpack'
13
+
14
+
exports= { /* ... */
15
+
module: {
16
+
rules: [
17
+
{
18
+
test:/(?:\.ngfactory\.js|\.ngstyle\.js|\.ts)$/,
19
+
loader: '@ngtools/webpack',
20
+
sourcemap: true
21
+
}
22
+
]
23
+
},
24
+
25
+
plugins: [
26
+
newAngularCompilerPlugin({
27
+
tsConfigPath: 'path/to/tsconfig.json',
28
+
entryModule: 'path/to/app.module#AppModule'
29
+
})
30
+
]
31
+
}
32
+
```
33
+
34
+
Angular version 2 and 4, use `AotPlugin`:
7
35
8
36
```typescript
9
37
import {AotPlugin} from'@ngtools/webpack'
@@ -14,6 +42,7 @@ exports = { /* ... */
14
42
{
15
43
test:/\.ts$/,
16
44
loader: '@ngtools/webpack',
45
+
sourcemap: true
17
46
}
18
47
]
19
48
},
@@ -27,9 +56,7 @@ exports = { /* ... */
27
56
}
28
57
```
29
58
30
-
The loader works with the webpack plugin to compile your TypeScript. It's important to include both, and to not include any other TypeScript compiler loader.
31
-
32
-
For Angular version 5 and up, import `AngularCompilerPlugin` instead of `AotPlugin`.
59
+
The loader works with webpack plugin to compile your TypeScript. It's important to include both, and to not include any other TypeScript compiler loader.
0 commit comments