-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwebpack.config.js
More file actions
44 lines (43 loc) · 885 Bytes
/
webpack.config.js
File metadata and controls
44 lines (43 loc) · 885 Bytes
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 path = require('path')
module.exports = {
devtool: 'source-map',
entry: [
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server',
'./src/main.js'
],
output: {
path: path.join(__dirname, '/dist'),
publicPath: '/',
filename: 'bundle.js'
},
module: {
rules: [{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'react-hot-loader/webpack!babel-loader'
},
{
test: /\.css?$/,
// exclude: /node_modules/,
use: ['style-loader', 'css-loader']
},
{
test: /\.(ttf|woff|woff2|eot)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'file-loader'
},
{
test: /\.(gif|png|jpe?g|svg)$/i,
loaders: [
'file-loader'
]
}]
},
resolve: {
extensions: ['*', '.js', '.jsx']
},
devServer: {
contentBase: './dist',
hot: true
}
}