From 17625f408d540e47afc881478e8ddbd30118c2f8 Mon Sep 17 00:00:00 2001 From: Kitteh Date: Mon, 3 May 2021 15:56:21 +0100 Subject: [PATCH] Add some more options to webpack. --- webpack.config.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index ca3aa59..2fb3bb9 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,13 +2,24 @@ const path = require('path'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); +const VERBOSE = Object.getOwnPropertyNames(process.env).includes("VERBOSE") || !true; +const MODE = process.env.WEBPACK_MODE || "production" +const DEBUG = MODE != "production"; + + module.exports = { - mode: process.env.WEBPACK_MODE || "production", + mode: MODE, + cache: DEBUG, entry: './src/main.js', output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.js', }, + stats: { + preset: VERBOSE ? "detailed" : "normal", + colors: true, + timings: true, + }, plugins: [new MiniCssExtractPlugin(), new HtmlWebpackPlugin({ title: "VaultUI" })], devServer: { open: process.env.BROWSER || "microsoft-edge-dev",