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
Then use, `javascript_packs_with_chunks_tag`helper to include all the transpiled
280
+
Then use the `javascript_packs_with_chunks_tag`and `stylesheet_packs_with_chunks_tag` helpers to include all the transpiled
281
281
packs with the chunks in your view, which creates html tags for all the chunks.
282
282
283
283
```erb
@@ -304,6 +304,20 @@ get duplicated chunks on the page.
304
304
305
305
For the old configuration with the CommonsChunkPlugin see below. **Note** that this functionality is deprecated in Webpack V4.
306
306
307
+
#### Preloading
308
+
309
+
Before preload or prefetch your assets, please read [https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content](https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content).
310
+
311
+
Webpack also provide it's own methods for preload or prefetch [https://medium.com/webpack/link-rel-prefetch-preload-in-webpack-51a52358f84c](https://medium.com/webpack/link-rel-prefetch-preload-in-webpack-51a52358f84c).
312
+
313
+
You can preload your assets with the `preload_pack_asset` helper if you have Rails >= 5.2.x.
**Warning:** You don't want to preload the css, you want to preload the fonts and images inside the css so that fonts, css, and images can all be downloaded in parallel instead of waiting for the browser to parse the css.
320
+
307
321
### Add common chunks (deprecated in Webpack V4)
308
322
309
323
The CommonsChunkPlugin is an opt-in feature that creates a separate file (known as a chunk), consisting of common modules shared between multiple entry points. By separating common modules from bundles, the resulting chunked file can be loaded once initially, and stored in the cache for later use. This results in page speed optimizations as the browser can quickly serve the shared code from the cache, rather than being forced to load a larger bundle whenever a new page is visited.
0 commit comments