Skip to content
This repository was archived by the owner on Mar 20, 2024. It is now read-only.

Commit 9ec4cbf

Browse files
Foxandxsswardbell
authored andcommitted
docs(component-relative): tweak webpack explanation
closes #2157 Fixes #2156
1 parent 128915d commit 9ec4cbf

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

public/docs/ts/latest/cookbook/component-relative-paths.jade

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff 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
129129
a#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).

public/docs/ts/latest/guide/webpack.jade

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ p.
441441
`src/vendor.ts,
442442
src/polyfills.ts`
443443
)
444+
<a id="highlights"></a>
444445
:marked
445446
### Highlights:
446447

0 commit comments

Comments
 (0)