-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.build.config.js
57 lines (55 loc) · 1.4 KB
/
webpack.build.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
'use strict'
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var webpack = require('webpack')
module.exports = {
entry: {
app: './src/index',
vendor: [
'babel-core/browser',
'base-64',
'boxxy',
'classnames',
'codemirror',
'codemirror/addon/mode/overlay',
'codemirror/addon/mode/multiplex',
'codemirror/mode/javascript/javascript',
'codemirror/mode/markdown/markdown',
'codemirror/mode/xml/xml',
'codemirror/mode/gfm/gfm',
'marked',
'react',
'react-router',
'react-codemirror',
'redux'
]
},
node: {
buffer: false,
global: false,
process: false
},
output: {
path: 'public',
filename: 'app.js'
},
plugins: [
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({'process.env.NODE_ENV': JSON.stringify('production')}),
new ExtractTextPlugin('style.css'),
new webpack.optimize.CommonsChunkPlugin('vendor', 'deps.js'),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false
}
})
],
module: {
loaders: [
{test: /\.js$/, loader: 'babel', exclude: /node_modules/},
{test: /\.json$/, loader: 'json'},
{test: /\.css$/, loader: ExtractTextPlugin.extract('style', 'css?-restructuring!autoprefixer')}
]
}
}