-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.dev.js
70 lines (68 loc) · 2.23 KB
/
webpack.dev.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
const webpack = require("webpack");
const path = require('path');
const FriendlyErrorsWebpackPlugin = require("friendly-errors-webpack-plugin");
const CleanWebpackPlugin = require('clean-webpack-plugin');
const DashboardPlugin = require('webpack-dashboard/plugin');
module.exports = merge(common, {
mode: 'development',
output: {
path: path.resolve("./output/webpack/development"),
filename: "bundle-web-dev.js",
publicPath: '/'
},
devtool: 'inline-source-map',
devServer: {
hot: true,
historyApiFallback: true,
contentBase: "./output/webpack/devserver",
watchContentBase: true,
port: 3001,
overlay: {warnings: false,errors: true},
stats: {
assets: false,
colors: true,
version: false,
hash: false,
timings: false,
chunks: false,
chunkModules: false,
modules: true,
errorDetails: true
}
},
plugins: [
new CleanWebpackPlugin(['./output/webpack/development']),
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({"process.env.NODE_ENV": JSON.stringify("development")}),
new webpack.LoaderOptionsPlugin({debug: true}),
new DashboardPlugin()
],
module: {
rules: [
{
enforce: "pre",
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "eslint-loader",
options: {
formatter: require("eslint-friendly-formatter"),
quiet: false,
failOnError: true,
failOnWarning: false,
emitError: true,
emitWarning: true,
configFile: "./.eslintrc.json",
outputReport: {
filePath: 'checkstyle.xml',
formatter: require('eslint/lib/formatters/checkstyle')
}
}
}
}
]
}
}
);