Comments (4)
That's a great feature request - don't know right now how we could implement it.
The information is in the compilation
variable in https://github.com/jantimon/resource-hints-webpack-plugin/blob/master/index.js#L54
But how could a good configuration syntax look like?
from resource-hints-webpack-plugin.
Would it be too confusing to just list the name of the bundles like so:
prefetch: ['bundlea', 'bundleb'],
Of course there could be some overlap with files, but that could be solved by checking both?
from resource-hints-webpack-plugin.
Right now a string would add the string to allow adding images or fonts
from resource-hints-webpack-plugin.
So I've come to use this plugin but the only assets which are passed through are only those chunks which are already used for that page and nothing else.
Ie.
<link rel="prefetch" href="vendor.js">
<link rel="prefetch" href="main.js">
<script src="vendor.js"></script>
<script src="main.js"></script>
I kinda feel like I'm doing something wrong since this seems kinda redundant? The list referenced in the source seems to just be the scripts which are rendered into the body.
Anyway.
Why not just use Object.keys(compilation.assets)
in the plugin to allow people to reference and prefetch/preload any of the assets which are output by the webpack compilation?
from resource-hints-webpack-plugin.
Related Issues (11)
- *.* default as filter excludes files in target folder HOT 1
- It is not support webpack 4 HOT 4
- Use all without js files
- Support for html-webpack-plugin 4 HOT 1
- JS files must have `as='script` attr HOT 3
- Files appear to be downloading 3 times HOT 5
- Needs `as` attribute HOT 1
- Can I use this to prefetch external URLs?
- Prefetch/preload any Webpack asset instead of HTMLWebpackPlugin tags HOT 1
- How can I inject <link>s to preload font files? HOT 1
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 resource-hints-webpack-plugin.