Comments (5)
@igrigorik what are your thoughts on this?
from preload-webpack-plugin.
I don't think I have enough context here to make an informed comment.. what is the plugin preloading? Note the preload requires as
, which specifies the type of resource being preloaded -- e.g. if you as=script
then the priority of that resource is the same as fetching via <script>
.
from preload-webpack-plugin.
My hypothesis is that default setup of this plugin could actually hurt performance. It adds the resource with the highest prio on the network queue.
I don't feel I'm following. The default setup here is structured around a developer preloading scripts they know are going to be used for the current session or closely thereafter - this isn't different to how one would manually go about tackling the problem. We don't encourage preloading all resources to avoid excessive network congestion etc.
Perhaps you could share a code sample of where you think the defaults might steer folks astray? Right now, it's been doing what I would expect correctly in my own apps.
from preload-webpack-plugin.
+1
When i first time found this plugin i thought that it would help me optimizing the performance of my site. But actually i was wrong. This plugin is not what i need: I expected the plugin to load some async chunks only after the resources which current page needs are loaded completely. Then when i go to another page the resources of that page are already loaded.
from preload-webpack-plugin.
Re-reading through this thread, it sounds like this is more of a documentation issue that I need to work on. The plugin has been written with enough flexibility to:
-
Preload resources you've observed to be discovered late in your network waterfall. The onus is on the developer using the plugin to make the right choice of what resources need to be loaded with a higher priority. It definitely isn't the case that we expect every script generated from your Webpack pipeline to fall into this category. It just may be the case that many of these are needed for your SPA to get interactive sooner so preloading them sooner may be beneficial.
-
Prefetch. While the plugin has preload in the name, I personally prefetch my lazy/async chunks while preloading my main bundles to ensure that I'm not running into too much network contention. We're definitely not trying to be too magical here with what is prescribed.
I'll take an AI to better reflect some of the nuance here in the README. In short, folks should be sure that preloading or prefetching specific resources are going to have a measurable improvement (with or without this plugin) - the plugin is there to help you avoid wiring challenges, in particular when your chunk names might be dynamically generated/done in a non-easily deterministic way.
from preload-webpack-plugin.
Related Issues (20)
- Can I use prealod webpack plugin with Webpack 3xx ?
- Expo for web compatibility
- Publish v3 to npm HOT 5
- Add links based on webpackPreload/webpackPrefetch magic comments HOT 1
- working
- ability to remove crossorigin
- crossorigin='crossorigin' issue on fonts
- how to make it do a link with prefetch assets in include is asyncChunk
- The stylesheet file and the preloaded styles are not in the correct order HOT 1
- 'html-webpack-plugin-before-html-processing'. Hook was not found. HOT 2
- Bug of fileBlacklist shadow merge
- How to use in MPA config to load async chunks?
- assets'path inject incorrent
- How to preload some of assets
- Webpack 5 Support? HOT 4
- Merge changes from tag 3.0.0-beta.4 HOT 2
- Use regex in 'include' option
- assets inject incorrent(produce three files for one file) HOT 1
- Support imagesrcset and imagesizes
- Feature to opt-in to CORS preload requests HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from preload-webpack-plugin.