Comments (5)
Thanks for the valuable input, @jantimon. Still getting with hang of what are idiomatic best practices for Webpack plugins :)
https://github.com/jantimon/resource-hints-webpack-plugin/blob/master/index.js#L87-L89 feels a lot cleaner than the approach we're currently using here. I'm in favor of switching to it.
https://github.com/jantimon/resource-hints-webpack-plugin/blob/master/index.js#L55 appears to be where you're merging html-webpack-plugin's options with custom ones. I see no reason not to switch over to doing something similar there. I hadn't considered the multiple instance usecase but appreciate the tips!
from preload-webpack-plugin.
@addyosmani cool 👍 for the html-webpack-plugin 3 version there will be an api to create custom tag elements:
https://github.com/jantimon/html-webpack-plugin/blob/version-3.x/lib/html-tags.js#L28
Maybe we will also backport it to the 2.x branch
I am always happy for feedback from plugin authors on the events and options - so if something feels to complicated please let me know
from preload-webpack-plugin.
@addyosmani We can actually keep the current API as the default options for every hmtl-webpack-plugin instance, and each instance can override them if required. One thing to consider moving options into html-webpack-plugin is naming conflicts with other plugins.
from preload-webpack-plugin.
We can actually keep the current API as the default options for every hmtl-webpack-plugin instance, and each instance can override them if required.
That sounds pretty reasonable to me as well.
cool 👍 for the html-webpack-plugin 3 version there will be an api to create custom tag elements:
@jantimon Oh that's totally rad. Thanks for sharing that insight. I'd be interested in it being backported, but don't want to add too much to your workload - is V3's api surface vastly different?
from preload-webpack-plugin.
The tag structure is compatible with the current html-webpack-plugin version. The main idea behind 3.x is to get closer to the webpack 2.x internals and that causes some breaking changes but we try to introduce as few api changes as possible. Your plugin shouldn't be affected at all.
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.