changed webpack devserver config

This commit is contained in:
Niklas 2020-04-22 15:13:33 +02:00
parent 9eb99397f1
commit 14e9cceac4
2 changed files with 9 additions and 5 deletions

View File

@ -4,7 +4,7 @@
"description": "",
"main": "src/index.ts",
"scripts": {
"devServer": "webpack-dev-server --mode development --inline --hot --open",
"devServer": "webpack-dev-server --mode development --open",
"build": "webpack --mode development",
"buildProd": "webpack --mode production"
},

View File

@ -1,6 +1,8 @@
/* eslint-env node */
/* eslint-disable @typescript-eslint/no-var-requires */
const HtmlWebpackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const webpack = require("webpack");
const path = require("path");
module.exports = {
@ -15,11 +17,13 @@ module.exports = {
},
devtool: "source-map",
devServer: {
contentBase: "./dist", // Content base
inline: true, // Enable watch and live reload
contentBase: "./dist",
inline: true,
host: "localhost",
port: 8080,
stats: "errors-only"
stats: "errors-only",
liveReload: true,
watchContentBase: true
},
module: {
rules: [