Skip to content

Commit f2f4bc4

Browse files
committed
Update changelog too
1 parent a42bc1d commit f2f4bc4

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,31 @@
66
- Issue with javascript_pack_tag asset duplication [#1898](https://github.com/rails/webpacker/pull/1898)
77

88

9+
### Added
10+
- `javascript_packs_with_chunks_tag` helper, which creates html tags
11+
for a pack and all the dependent chunks, when using splitchunks.
12+
13+
```erb
14+
<%= javascript_packs_with_chunks_tag 'calendar', 'map', 'data-turbolinks-track': 'reload' %>
15+
16+
<script src="/packs/vendor-16838bab065ae1e314.js" data-turbolinks-track="reload"></script>
17+
<script src="/packs/calendar~runtime-16838bab065ae1e314.js" data-turbolinks-track="reload"></script>
18+
<script src="/packs/calendar-1016838bab065ae1e314.js" data-turbolinks-track="reload"></script>
19+
<script src="/packs/map~runtime-16838bab065ae1e314.js" data-turbolinks-track="reload"></script>
20+
<script src="/packs/map-16838bab065ae1e314.js" data-turbolinks-track="reload"></script>
21+
```
22+
23+
**Important:** Pass all your pack names when using `javascript_packs_with_chunks_tag`
24+
helper otherwise you will get duplicated chunks on the page.
25+
26+
```erb
27+
<%# DO %>
28+
<%= javascript_packs_with_chunks_tag 'calendar', 'map' %>
29+
30+
<%# DON'T %>
31+
<%= javascript_packs_with_chunks_tag 'calendar' %>
32+
<%= javascript_packs_with_chunks_tag 'map' %>
33+
```
934

1035
## [4.0.0.rc.2] - 2018-12-15
1136

0 commit comments

Comments
 (0)