'Webpack - mimic gulp html include

Just started using webpack and I'm trying to duplicate the following gulp setup:

  • bootstrap 5 with a highly customized theme.
  • various html partials (e.g. head, footer, navbar) that are generally common to all pages.
  • target html pages with @@include placeholders
  • gulp js that merges the partials into each target html page

Trying to do something similar with webpack, but all the examples I've seen don't seem to use html as an entry point.

Is this use case even doable with webpack? I've looked at a number of webpack plugins, including html-webpack-plugin, but none of them seem to duplicate what the gulp-file-include plugin does...

Any suggestions re a webpack plugin that does this?

Thx



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source