preload-webpack-plugin icon indicating copy to clipboard operation
preload-webpack-plugin copied to clipboard

How to preload js file in multiple html page?

Open happylindz opened this issue 5 years ago • 3 comments

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 avatar Jun 23 '19 09:06 happylindz

@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 avatar Jun 26 '19 08:06 vs28031996

@vs28031996 No, I didn't try it. I think it is a solution to solve the problem but a little trouble.

happylindz avatar Jun 26 '19 08:06 happylindz

I have the same issue, I believe we have to wait for https://github.com/GoogleChromeLabs/preload-webpack-plugin/pull/109

sqal avatar Feb 19 '20 12:02 sqal