-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathwebpack.config.js
45 lines (42 loc) · 934 Bytes
/
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
const HtmlWebpackPlugin = require('html-webpack-plugin'); //installed via npm
const webpack = require('webpack'); //to access built-in plugins
var path = require('path')
var serverConfig = {
target: 'node',
entry: "./_server/index.js",
watch: true,
output: {
path: path.resolve(__dirname, 'bin/server'),
filename: 'index.js'
}
}
var clientConfig = {
target: 'web',
entry: "./_client/index.js",
watch: true,
output: {
path: path.resolve(__dirname, 'bin/client'),
filename: 'index.js'
},
module: {
loaders: [
{
test: /\.js?$/,
exclude: /node_modules/,
loaders: ["babel-loader"]
}
]
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
output: {
comments: false
}
}),
new HtmlWebpackPlugin({template: './_client/index.html'})
]
}
module.exports = [ clientConfig ];