In version 1.0.0 of Webpack's html-loader, the interpolate
option has been deprecated, in favour of preprocessor
(according to their changelog). interpolate
enabled interpolation syntax for ES6 template strings, allowing you to import other html partials inside html files like so:
<div>${require('./components/gallery.html')}</div>
This was the de-facto way to implement html partials with html-loader, as several stack overflow suggested this solution.
However, now that that flag has been deprecated, I'm struggling to figure out how to enable this using the preprocessor
option. The example in their github page comes with a handlebards implementation, but you didn't need this in the previous version - with interpolation the require
syntax it all worked out of the box.
Anyone managed to replicate this html partials setup with the latest version of html-loader?