colbyfayock / html-webpack-partials-plugin

🛠 Easy HTML partials for Webpack without a custom index!
MIT License
68 stars 20 forks source link

Question: Multiple partials for one page ? #11

Closed Legends closed 4 years ago

Legends commented 4 years ago

I have setup my project to use the partials plugin for loading content pages (body-xyz.html). Now I have one layout.ejs page which requires other html templates, which in whole represent the layout page, means: this layout page is the basis for all pages.

Now I use your plugin for everyhtml-webpack-plugin configuration to dynamically inject the respective body.html.

Unfortunately after upgrading my project to use latest beta version of the html-webpack-plugin , I cannot require anymore. see issue.

Now my question: I would delete all require calls in my layout page and use your plugin to inject the respective partial I need. I would delete this for example: ` ${require('../../partials/nav.html')} // inside of layout.ejs

Is there a way to configure multiple partials with respective location set for a certain page?

Btw. Appreciate your plugin !

Legends commented 4 years ago

This should actually be possible by defining multiple entries in settings object pointing to the same file

colbyfayock commented 4 years ago

ah didn't realize upgrading to the latest beta is what was breaking that, should have figured, but glad to know that. I tried to take a shot at figuring this out a while back but I wasn't getting anywhere, I can another shot and see if I can find anything. maybe I can make use of the info in that linked issue, i'll follow up with any additional details in the other issue here