forked from laurentlaporte/node-slack-clone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
43 lines (42 loc) · 1.15 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
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: {
app: "./client/main.js",
vendor: ['react', 'react-dom', 'redux', 'react-redux']
},
output: {
filename: "server/public/bundle.js"
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel',
query: {
presets: ['react', 'es2015'],
plugins: ['transform-class-properties', 'transform-object-rest-spread']
}
},
{
test: /\.less$/,
loader: ExtractTextPlugin.extract('style?sourceMap', 'css?sourceMap!less?sourceMap')
// loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-loader")
}
]
},
plugins: [
new ExtractTextPlugin("server/public/bundle.css"),
new webpack.optimize.CommonsChunkPlugin('vendor', 'server/public/vendor.js'),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production'),
}
}),
new webpack.optimize.UglifyJsPlugin({
warnings: false
})
]
// devtool: 'source-map'
}