From 23deb6fc2f8535bc420f9628b00b189dcff22d78 Mon Sep 17 00:00:00 2001 From: abhijithvijayan <34790378+abhijithvijayan@users.noreply.github.com> Date: Fri, 25 Oct 2019 13:51:02 +0530 Subject: [PATCH] use html-webpack-plugin to inject js file on build --- src/options.html | 4 +--- src/popup.html | 4 +--- webpack.config.js | 15 +++++++++++++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/options.html b/src/options.html index 82535cc..a814d56 100644 --- a/src/options.html +++ b/src/options.html @@ -7,7 +7,5 @@ - - - + diff --git a/src/popup.html b/src/popup.html index 879ee7e..ce1bb49 100644 --- a/src/popup.html +++ b/src/popup.html @@ -7,7 +7,5 @@ - - - + diff --git a/webpack.config.js b/webpack.config.js index 95ca5ef..c9b6189 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -21,6 +21,7 @@ module.exports = { }, plugins: [ + new webpack.ProgressPlugin(), new FixStyleOnlyEntriesPlugin({ silent: true }), new CleanWebpackPlugin({ cleanOnceBeforeBuildPatterns: [path.join(process.cwd(), `extension/${process.env.TARGET}`)], @@ -31,8 +32,18 @@ module.exports = { { from: 'src/assets', to: 'assets' }, { from: `src/manifests/${process.env.TARGET}.json`, to: 'manifest.json' }, ]), - new webpack.ProgressPlugin(), - new HtmlWebpackPlugin(), + new HtmlWebpackPlugin({ + template: 'src/options.html', + // inject: false, + chunks: ['options'], + filename: 'options.html', + }), + new HtmlWebpackPlugin({ + template: 'src/popup.html', + // inject: false, + chunks: ['popup'], + filename: 'popup.html', + }), ], module: {