Commit e56f98f0 by Ryan McKinley Committed by Torkel Ödegaard

@grafana/toolkit: HtmlWebpackPlugin when in watch mode (#18130)

parent 2a70ccb5
......@@ -43,6 +43,7 @@
"file-loader": "^4.0.0",
"glob": "^7.1.4",
"html-loader": "0.5.5",
"html-webpack-plugin": "^3.2.0",
"inquirer": "^6.3.1",
"jest": "24.8.0",
"jest-cli": "^24.8.0",
......
......@@ -5,6 +5,7 @@ const ReplaceInFileWebpackPlugin = require('replace-in-file-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
import * as webpack from 'webpack';
import { getStyleLoaders, getStylesheetEntries, getFileLoaders } from './webpack/loaders';
......@@ -116,6 +117,8 @@ export const getWebpackConfig: WebpackConfigurationGetter = options => {
if (options.production) {
optimization.minimizer = [new TerserPlugin(), new OptimizeCssAssetsPlugin()];
} else if (options.watch) {
plugins.push(new HtmlWebpackPlugin());
}
return {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment