preload-webpack-plugin
preload-webpack-plugin copied to clipboard
How to preload js file in multiple html page?
Thanks to provide the nice plugin, but I got a problem: In my project, I have multiple entry(many pages) and some common chunks. How could I do to let each page include some common preloaded chunks and their own page chunk?
@happylindz , did you tried something like this -
new preloadWebpackPlugin({
rel: 'preload',
include: ['runtime', 'polyfills'] //common ones
}),
new preloadWebpackPlugin({
rel: 'preload',
include: ['blah-styles'], // including specific chunks for specific page
excludeHtmlNames: ['../index-blah.html', '../index-blahblah.html'] //ignore for these files
})
@vs28031996 No, I didn't try it. I think it is a solution to solve the problem but a little trouble.
I have the same issue, I believe we have to wait for https://github.com/GoogleChromeLabs/preload-webpack-plugin/pull/109