File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 6
6
- Issue with javascript_pack_tag asset duplication [ #1898 ] ( https://github.com/rails/webpacker/pull/1898 )
7
7
8
8
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
+ ```
9
34
10
35
## [ 4.0.0.rc.2] - 2018-12-15
11
36
You can’t perform that action at this time.
0 commit comments