-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
58 lines (51 loc) · 1.23 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
var webpack = require('webpack')
var path = require('path')
module.exports = {
entry: {
bundle: ['webpack-dev-server/client?http://localhost:8080', 'webpack/hot/only-dev-server', './src/js/scenes/index']
},
stats: {
colors: true,
reasons: true
},
resolve: {
root: path.resolve(__dirname),
alias: {
componentsRoot: 'src/js/components',
constants: 'src/js/constants',
core: 'src/js/core',
scenes: 'src/js/scenes',
images: 'img',
test: 'test'
},
extensions: ['', '.js', '.jsx']
},
output: {
path: path.join(__dirname, '/dist/'),
filename: '[name].js',
publicPath: 'http://localhost:8080/dist/'
},
devtool: 'source-map',
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})
],
module: {
loaders: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loaders: ['react-hot', 'babel?presets[]=es2015&presets[]=react']
},
{
test: /\.(png|jpg)$/,
exclude: /node_modules/,
loader: 'url-loader?limit=8192' // inline base64 URLs for <=8k images, direct URLs for the rest
}
]
}
}