1
0
Fork 0

Add some more options to webpack.

This commit is contained in:
Kitteh 2021-05-03 15:56:21 +01:00
parent f6209b119d
commit 17625f408d

View file

@ -2,13 +2,24 @@ const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const HtmlWebpackPlugin = require('html-webpack-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 = { module.exports = {
mode: process.env.WEBPACK_MODE || "production", mode: MODE,
cache: DEBUG,
entry: './src/main.js', entry: './src/main.js',
output: { output: {
path: path.resolve(__dirname, 'dist'), path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js', filename: 'bundle.js',
}, },
stats: {
preset: VERBOSE ? "detailed" : "normal",
colors: true,
timings: true,
},
plugins: [new MiniCssExtractPlugin(), new HtmlWebpackPlugin({ title: "VaultUI" })], plugins: [new MiniCssExtractPlugin(), new HtmlWebpackPlugin({ title: "VaultUI" })],
devServer: { devServer: {
open: process.env.BROWSER || "microsoft-edge-dev", open: process.env.BROWSER || "microsoft-edge-dev",