-
Notifications
You must be signed in to change notification settings - Fork 9
/
webpack.dev-server.config.js
48 lines (46 loc) · 1.19 KB
/
webpack.dev-server.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
import path from 'path';
import webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
const PORT = 3000;
export default {
port: PORT,
devtool: 'eval-source-map',
entry: [
'./src/index',
'webpack/hot/dev-server',
`webpack-dev-server/client?http://localhost:${PORT}`
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: ''
},
module: {
loaders: [{
test: /\.js$/,
loaders: ['babel'],
include: path.join(__dirname, 'src')
}, {
test: /\.styl$/,
/* eslint-disable max-len */
loader: 'style-loader!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!stylus-loader'
/* eslint-enable max-len */
}, {
test: /\.woff$/,
loader: 'file-loader?name=font/[name].[ext]?[hash]'
}, {
test: /\.png$/,
loader: 'file-loader?name=images/[name].[ext]?[hash]'
}, {
test: /\.jade$/,
loader: 'jade-react-loader'
}, {
test: /\.md$/,
loader: 'html!markdown'
}]
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({ template: 'src/index.html', inject: 'body' })
]
};