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
{{ message }}
This repository was archived by the owner on Dec 4, 2017. It is now read-only.
Copy file name to clipboardExpand all lines: public/docs/ts/latest/guide/webpack.jade
+10-4Lines changed: 10 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -233,9 +233,10 @@ a(id="common-configuration")
233
233
234
234
:marked
235
235
* ts - a loader to transpile our Typescript code to ES5, guided by the `tsconfig.json` file
236
+
* angular2-template-loader - loads angular components' template and styles
236
237
* html - for component templates
237
238
* images/fonts - Images and fonts are bundled as well.
238
-
* css - The pattern matches application-wide styles; the second handles component-scoped styles (the ones specified in a component's `styleUrls` metadata property).
239
+
* css - The pattern matches application-wide styles; the second handles component-scoped styles (the ones specified in a component's `styleUrls` metadata property)
239
240
.l-sub-section
240
241
:marked
241
242
The first pattern excludes `.css` files within the `/src/app` directories where our component-scoped styles sit.
@@ -245,6 +246,10 @@ a(id="common-configuration")
245
246
The second pattern filters for component-scoped styles and loads them as strings via the `raw` loader —
246
247
which is what Angular expects to do with styles specified in a `styleUrls` metadata property.
247
248
249
+
.l-sub-section
250
+
:marked
251
+
Multiple loaders can be also chained using the array notation.
252
+
248
253
:marked
249
254
Finally we add two plugins:
250
255
@@ -441,9 +446,10 @@ p.
441
446
The `HtmlWebpackPlugin` inserts them dynamically at runtime.
442
447
443
448
* The `AppComponent` in `app.component.ts` imports the application-wide css with a simple `import` statement.
444
-
445
-
* The `AppComponent` itself has its own html template and css files which we load with the `require()` method
446
-
supplied by Webpack. Webpack stashes those component-scoped files in the `app.js` bundle too.
449
+
450
+
* The `AppComponent` itself has its own html template and css file. WebPack loads them with calls to `require()`.
451
+
Webpack stashes those component-scoped files in the `app.js` bundle too.
452
+
We don't see those calls in our source code; they're added behind the scenes by the `angular2-template-loader` plug-in.
447
453
448
454
* The `vendor.ts` consists of vendor dependency `import` statements that drive the `vendor.js` bundle.
449
455
The application imports these modules too; they'd be duplicated in the `app.js` bundle
0 commit comments