Answer the question
In order to leave comments, you need to log in
How to configure webpack html plugin correctly?
I can't figure out how the cashe option in the html webpack plugin works . The main documentation says:
cache | {Boolean} | true | Emit the file only if it was changed
const HtmlWebpackPlugin = require('html-webpack-plugin');
const PAGES_DIR = `${baseWebpackConfig.externals.paths.src}/html`;
const PAGES = fs.readdirSync(PAGES_DIR).filter(fileName => fileName.endsWith('.html'));
plugins: [
...PAGES.map(page => new HtmlWebpackPlugin({
cache: true,
template: `${PAGES_DIR}/${page}`,
filename: `./${page}`
})),
]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question