-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.dev.js
56 lines (55 loc) · 1.39 KB
/
webpack.config.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
const path = require('path')
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: [
'webpack-hot-middleware/client',
'babel-polyfill',
'./src/index'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle_[hash].js',
publicPath: 'http://localhost:3000/'
},
plugins: [
new HtmlWebpackPlugin({ template: 'html!./src/index.html', favicon: 'images/favicon.ico' }),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"development"'
})
],
module: {
loaders: [
{
test: /\.js?/,
exclude: [ /node_modules/, /styles/ ],
loaders: [ 'babel' ],
include: path.join(__dirname, 'src')
},
{
test: /\.global\.css$/,
loaders: [
'style-loader',
'css-loader?sourceMap'
]
},
{
test: /^((?!\.global).)*\.css$/,
loaders: [
'style-loader',
'css-loader?modules&sourceMap&importLoaders=1&localIdentName=[name]_[local]_[hash:base64]'
]
},
{
test: /\.(woff|woff2|eot|ttf|svg)$/,
loader: 'file-loader'
},
{
test: /\.(png|jpg)$/, loader: 'file-loader?name=images/[name].[ext]'
}
]
}
}