-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
42 lines (41 loc) · 1.14 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
const { resolve } = require('path');
const webpack = require('webpack');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
devtool: 'cheap-module-eval-sorce-map',
entry: [
'webpack-hot-middleware/client',
'babel-polyfill',
'react-hot-loader/patch',
'./server/index'
],
output: {
path: resolve(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/dist/'
},
plugins: [
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new UglifyJSPlugin,
// new webpack.NoErrorsPlugin()
],
module: {
loaders: [
{
test: /\.jsx?$/,
include: [
resolve(__dirname, 'server')
],
loaders: ['babel-loader']
},{
test: /(\.css|\.scss)$/,
include: [
resolve(__dirname, 'server'),
resolve(__dirname, 'node_modules')
],
loaders: ["style-loader", "css-loader"]
}
]
}
}