Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include html partials with webpack (version 2) with the html-loader?

I am working hard to include a simple footer.html, as an html partial) via html-loader. I am using webpack version 2.

I failed trying to use ${require('**./footer.html**')} and ${require('**../footer.html**')}.

I am not using ejs loader and I do not use the handlebar plugin.

Does somebody know how I can fix this problem and whether it possible to render partials with webpack.

Thanks for your advice!

like image 453
Mathias Avatar asked Sep 05 '25 05:09

Mathias


1 Answers

I use html-loader and simply add <%= require('html-loader!./partial/header.html') %> to my main index.html. Thats work for me.

like image 171
Serg Bolten Avatar answered Sep 07 '25 20:09

Serg Bolten