mirror of
https://github.com/grafana/grafana.git
synced 2025-02-14 01:23:32 -06:00
@grafana/toolkit: HtmlWebpackPlugin when in watch mode (#18130)
This commit is contained in:
parent
2a70ccb557
commit
e56f98f03f
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user