-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathwebpack.config.dev.js
101 lines (100 loc) · 2.74 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
cache: true,
debug: true,
devtool: 'cheap-module-eval-source-map',
entry: {
'app': [
'eventsource-polyfill', // necessary for hot reloading with IE
'webpack-hot-middleware/client',
'./index.js']
},
output: {
path: path.join(__dirname, './dist/static'),
filename: '[name].js',
publicPath: '/static/'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
],
resolve: {
extensions: ['', '.js', '.jsx', '.css', '.scss'],
alias: {
'SRC': path.resolve(__dirname, './src')
}
},
module: {
loaders: [{
test: /\.jsx?/,
loaders: ['babel'],
exclude: /node_modules/
},
{
test: /\.json$/,
exclude: /node_modules/,
loader: 'json-loader',
include: path.join(__dirname, 'src')
},
{
test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&minetype=application/font-woff',
include: path.join(__dirname, 'src')
},
{
test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&minetype=application/font-woff',
include: path.join(__dirname, 'src')
},
{
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&minetype=application/octet-stream',
include: path.join(__dirname, 'src')
},
{
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
loader: 'file',
include: path.join(__dirname, 'src')
},
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&minetype=image/svg+xml',
include: path.join(__dirname, 'src')
},
{
test: /.*\.(gif|png|jpe?g)$/i,
loader: "url-loader?mimetype=image/png",
include: path.join(__dirname, 'src')
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader'),
include: path.join(__dirname, 'src/assets')
// loader: 'style!css?sourceMap!autoprefixer-loader',
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]'),
include: path.join(__dirname, 'src/components')
// loader: 'style!css?sourceMap!autoprefixer-loader',
}
]
},
plugins: [
new ExtractTextPlugin('[name].css', {
disable: false,
allChunks: true
}),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('dev')
}
}),
new webpack.IgnorePlugin(/^\.\/locale$/, [/moment$/]),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
]
};