This repository was archived by the owner on Mar 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ include ../_util-fns
6969
7070.alert.is-helpful
7171 :marked
72- Webpack users may prefer [an alternative approach](#webpack) that uses `require` .
72+ Webpack users may prefer [an alternative approach](#webpack).
7373
7474.l-main-section
7575:marked
@@ -129,12 +129,18 @@ a#why-default
129129a#webpack
130130.l-main-section
131131:marked
132- ## Webpack: load templates and styles with *require*
132+ ## Webpack: load templates and styles
133133 Webpack developers have an alternative to `moduleId`.
134-
135- They can load templates and styles at runtime by setting the component metadata `template` and `style` properties
136- with `require` statements that reference *component-relative* URLS.
134+
135+ They can load templates and styles at runtime by adding `./` at the beginning of the `template` and `styles` / `styleUrls`
136+ properties that reference *component-relative URLS.
137137
138138+ makeExample('webpack/ts/src/app/app.component.ts' )( format ='.' )
139+
140+ .l-sub-section
141+ :marked
142+ Webpack will do a `require` behind the scenes to load the templates and styles. Read more [here](../guide/webpack.html#highlights).
143+
144+
139145:marked
140146 See the [Introduction to Webpack](../guide/webpack.html).
Original file line number Diff line number Diff line change 441441 ` src/vendor.ts,
442442 src/polyfills.ts`
443443)
444+ <a id =" highlights" ></a >
444445:marked
445446 ### Highlights:
446447
You can’t perform that action at this time.
0 commit comments