GoogleChromeLabs / prerender-loader

📰 Painless universal pre-rendering for Webpack.
https://npm.im/prerender-loader
Apache License 2.0
1.9k stars 50 forks source link

Extend entry support #8

Closed havenchyk closed 6 years ago

havenchyk commented 6 years ago

Add a basic support of object and array for entry property

accordingly with https://github.com/GoogleChromeLabs/prerender-loader/issues/3#issuecomment-393671513

developit commented 6 years ago

Looks good! Before we merge this, I want to double-check that there isn't already a way to handle this via Webpack (SingleEntryPlugin vs MultiEntryPlugin). Otherwise I think this will work great!

havenchyk commented 6 years ago

@developit From what I see, MultiEntryPlugin works the same way as Single, but we can pass an array there. There is also another like EntryPoint plugin, but I'm not sure how to use it because I'm not familiar how to apply it(constructor doesn't accept arguments and plugin relies only on event), but it handles all type of entry (array, object and string)

havenchyk commented 6 years ago

I meant https://github.com/webpack/webpack/blob/master/lib/EntryOptionPlugin.js

vaxilicaihouxian commented 6 years ago

Does this commit will fix the bug that entry is an object ?

havenchyk commented 6 years ago

@vaxilicaihouxian I hope so. https://github.com/GoogleChromeLabs/prerender-loader/pull/8/files#diff-c193db11b3837e38bd24c06b98cb93ffR38 this line uses entry as an object

vaxilicaihouxian commented 6 years ago

@havenchyk But it seems that this commit has not been merge to the master branch.How can I use it?Pull from your fork branch?

developit commented 6 years ago

Sorry for the delay! I have a project setup to test this easily now.