-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
39 lines (35 loc) · 928 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
var webpack = require('webpack');
const WebpackShellPlugin = require('webpack-shell-plugin');
var path = require('path');
var fs = require('fs');
var nodeModules = {};
fs.readdirSync('node_modules')
.filter(function(x) {
return ['.bin'].indexOf(x) === -1;
})
.forEach(function(mod) {
nodeModules[mod] = 'commonjs ' + mod;
});
module.exports = {
entry: './server.js',
target: 'node',
output: {
path: path.join(__dirname, 'build'),
filename: 'server.js',
libraryTarget : "commonjs2"
},
externals: nodeModules,
plugins: [
new webpack.IgnorePlugin(/\.(css|less)$/),
new webpack.BannerPlugin('require("source-map-support").install();'),
new WebpackShellPlugin({
onBuildEnd: [
'echo "Transfering files ... "',
'copy .\\process.env .\\build',
'copy .\\web.config .\\build',
'echo "DONE ... "',
]
})
],
devtool: 'sourcemap'
}