-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwebpack.config.js
63 lines (62 loc) · 1.46 KB
/
webpack.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
52
53
54
55
56
57
58
59
60
61
62
63
/* eslint-disable */
var webpack = require('webpack');
var path = require('path');
module.exports = {
devtool: process.env.NODE_ENV !== 'production' ? 'eval' : 'cheap-module-source-map',
entry: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'./app/App'
],
output: {
path: path.join(__dirname, 'build'),
filename: 'App.js',
publicPath: '/'
},
resolve: {
root: [
path.resolve('./app/'),
path.resolve('./node_modules/')
],
modulesDirectories: ['node_modules'],
extensions: ['', '.jsx', '.js']
},
module: {
preLoaders: [{
test: /\.jsx$/,
loader: 'eslint-loader'
}],
loaders: [
{
test: /\.(jsx|js)?$/,
exclude: /node_modules/,
loaders: ['babel', 'react-hot']
},
{test: /\.css$/, loader: 'style!css'},
{test: /\.less$/, loader: 'style!css!less'},
{test: /\.json$/, loader: 'json-loader'},
{test: /\.(png|eot|woff|woff2|svg|ttf)$/, loader: 'url-loader'}
]
},
plugins: [
new webpack.optimize.UglifyJsPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
process: {
env: {
NODE_ENV: '"' + process.env.NODE_ENV + '"',
BETA: JSON.stringify(JSON.parse(!!process.env.BETA))
}
}
})
],
devServer: {
contentBase: './build',
noInfo: false,
hot: true,
inline: true,
stats: {
colors: true
}
}
};