Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

How to preload js file in multiple html page? #96

Open
happylindz opened this issue Jun 23, 2019 · 3 comments
Open

How to preload js file in multiple html page? #96

happylindz opened this issue Jun 23, 2019 · 3 comments

Comments

@happylindz
Copy link

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?

@vs28031996
Copy link

vs28031996 commented Jun 26, 2019

@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
})

@happylindz
Copy link
Author

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

@sqal
Copy link

sqal commented Feb 19, 2020

I have the same issue, I believe we have to wait for #109

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants