K
K
Konstantin Velichko2019-05-08 14:02:12
webpack
Konstantin Velichko, 2019-05-08 14:02:12

How to generate html files using webpack?

There are several javascript files, each exporting a function that generates a string.

// a.js
export default () => `<div>Component A</div>`

You need to run the files through webpack to resolve the dependencies and run through babel, and save to a file with the appropriate name.
1. I tried to do it through html-webpack-pluginbut it works extremely crookedly ( working example )
2. I tried to do it through gulp and webpack, it works more or less ( working example )

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question