-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathwebpack.config.js
More file actions
68 lines (60 loc) · 1.57 KB
/
webpack.config.js
File metadata and controls
68 lines (60 loc) · 1.57 KB
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
var webpack = require('webpack');
var path = require('path');
module.exports = {
context: __dirname + '/app',
devtool: 'inline-source-map',
entry: [
'babel-polyfill',
'./app.js'
],
output: {
path: __dirname + '/build/',
filename: 'bundle.js',
chunkFilename: '[id].chunk.js',
publicPath: '/build/'
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['react', 'es2015'],
plugins: ['transform-runtime']
}
},
{
test: /.(png|jpg)$/,
loader: 'url-loader?limit=8192'
},
{
test: /\.css$/,
loader: 'style!css' //loaders: ['style', 'css']
},
{
test: /\.scss$/,
loader: 'style!css!sass'
}
]
},
resolve: {
fallback: [
path.join(__dirname, 'node_modules')
],
extendsions: ['', '.js', '.css']
},
resolveLoader: {
fallback: [
path.join(__dirname, 'node_modules')
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin('common.js'),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development')
})
]
}