Use HtmlWebpackPlugin for UI pages

This commit is contained in:
hensm
2020-09-04 18:22:23 +01:00
parent 6960508ca6
commit 01045a1889
5 changed files with 260 additions and 17 deletions

View File

@@ -1,8 +1,10 @@
"use strict";
const path = require("path");
const webpack = require("webpack");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const sourceFileExtensions = [
@@ -67,6 +69,19 @@ module.exports = (env) => ({
, to: path.join(env.outputPath, "vendor")
}
])
, new HtmlWebpackPlugin({
inject: true
, template: `${env.includePath}/ui/template.html`
, filename: `${env.outputPath}/ui/popup/index.html`
, chunks: [ "ui/popup/bundle" ]
})
, new HtmlWebpackPlugin({
inject: true
, template: `${env.includePath}/ui/template.html`
, filename: `${env.outputPath}/ui/options/index.html`
, chunks: [ "ui/options/bundle" ]
})
]
, module: {
rules: [