-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.dev.js
80 lines (77 loc) · 1.78 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
71
72
73
74
75
76
77
78
79
80
const webpack = require('webpack');
const merge = require('webpack-merge');
const path = require('path');
module.exports = merge([
{
devtool: 'source-map',
devServer: {
compress: true, //gzip
contentBase: path.resolve(__dirname, 'app'), // for static files
disableHostCheck: true, // bypass host checking
historyApiFallback: {
disableDotRule: true
},
host: process.env.HOST,
hot: false, // for now
inline: true, // alternative is iframe
lazy: false,
noInfo: false,
open: false, //open web browser
openPage: '',
port: 8000, // process.env.PORT,
overlay: {
errors: true,
warnings: true
},
publicPath: '/',
quiet: false,
stats: 'errors-only', // minimal, normal, detailed, verbose
// sockjsPrefix: '/app',
useLocalIp: false,
watchContentBase: true,
watchOptions: {
aggregateTimeout: 300
}
},
// entry: [
// 'webpack-dev-server/client?http://localhost:8000',
// bundle the client for webpack-dev-server
// and connect to the provided endpoint
// 'webpack/hot/only-dev-server',
// bundle the client for hot reloading
// only- means to only hot reload for successful updates
// the entry point of our app
// './app/index.ts'
// ],
module: {
rules: [
{
test: /\.ts$/,
enforce: 'pre',
exclude: ['node_modules'],
loader: 'tslint-loader',
options: {
configFile: 'tslint.json',
emitErrors: true,
failOnHint: true
}
},
{
test: /\.js$/,
// enforce: 'pre',
loader: 'eslint-loader',
options: {
emitWarning: true
}
}
]
},
plugins: [
// new webpack.HotModuleReplacementPlugin(),
// new webpack.NamedModulesPlugin(),
new webpack.WatchIgnorePlugin([
path.resolve(__dirname, 'node_modules')
])
]
}
]);