-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
44 lines (42 loc) · 1022 Bytes
/
webpack.config.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
const { resolve } = require('path');
const webpack = require('webpack');
const HOST = 'localhost';
const PORT = 8080;
const _PATH = resolve(__dirname, 'src');
module.exports = {
entry: [
`webpack-dev-server/client?http://${HOST}:${PORT}`,
'./main.js'
],
output: {
filename: 'bundle.js',
path: _PATH,
publicPath: '/',
},
context: _PATH,
devtool: 'cheap-module-eval-source-map',
devServer: {
contentBase: _PATH,
publicPath: '/',
compress: true,
port: PORT
},
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader?cacheDirectory'
}
]
},
resolve: {
modules: [ _PATH, 'node_modules' ],
extensions: [ '.js' ]
},
plugins: [
new webpack.NamedModulesPlugin(),
new webpack.EvalSourceMapDevToolPlugin(),
new webpack.NoEmitOnErrorsPlugin()
]
};