From f4c747dd7e6dac9e5f3e5662fb35483f4a72c9a0 Mon Sep 17 00:00:00 2001 From: Manuel Bouza Date: Fri, 5 Jun 2020 09:52:44 +0200 Subject: [PATCH] Fix html webpack plugin Html files got deleted after a rebuild --- webpack.base.config.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webpack.base.config.js b/webpack.base.config.js index 6bdea56..e99e890 100644 --- a/webpack.base.config.js +++ b/webpack.base.config.js @@ -7,7 +7,7 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin") const HtmlWebpackPlugin = require("html-webpack-plugin") const ZipPlugin = require("zip-webpack-plugin") -module.exports = env => { +module.exports = (env) => { const config = { entry: { background: "./src/js/background.js", @@ -73,17 +73,17 @@ module.exports = env => { }), new HtmlWebpackPlugin({ template: path.join(__dirname, "src", "background.html"), - filename: "background.html", + filename: path.resolve(`build/${env.browser}`, "background.html"), chunks: ["background"], }), new HtmlWebpackPlugin({ template: path.join(__dirname, "src", "popup.html"), - filename: "popup.html", + filename: path.resolve(`build/${env.browser}`, "popup.html"), chunks: ["popup"], }), new HtmlWebpackPlugin({ template: path.join(__dirname, "src", "options.html"), - filename: "options.html", + filename: path.resolve(`build/${env.browser}`, "options.html"), chunks: ["options"], }), ],