-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.dev.config.js
51 lines (49 loc) · 1.02 KB
/
webpack.dev.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
45
46
47
48
49
50
51
const webpack = require('webpack');
const path = require('path');
const dist = 'dist/';
module.exports = {
entry: [
'webpack-dev-server/client?http://127.0.0.1:3000/',
'webpack/hot/only-dev-server',
'./src/index',
],
output: {
path: path.join(__dirname, dist),
publicPath: 'http://127.0.0.1:3000/',
contentBase: dist,
filename: 'bundle.js',
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
},
{
test: /\.jsx$/,
loaders: ['react-hot', 'babel-loader'],
exclude: /node_modules/,
},
{
test: /\.s(a|c)ss$/,
loaders: ['style', 'css', 'sass'],
},
{
test: /\.css$/,
loaders: ['style', 'css'],
},
{
test: /\.json$/,
loader: 'json',
},
],
},
resolve: {
extensions: ['', '.js', '.jsx'],
modulesDirectories: ['node_modules'],
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
],
};