-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.dev.config.js
More file actions
39 lines (35 loc) · 835 Bytes
/
Copy pathwebpack.dev.config.js
File metadata and controls
39 lines (35 loc) · 835 Bytes
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 fs = require('fs');
var webpack = require('webpack');
function readExternals() {
// We need to exclude node_modules, otherwise webpack will bundle them
var nodeModules = {};
fs.readdirSync('./node_modules')
.filter(function (x) {
return ['.bin'].indexOf(x) === -1;
})
.forEach(function (mod) {
nodeModules[mod] = 'commonjs ' + mod;
});
return nodeModules;
}
module.exports = {
target: 'node',
node: {
__dirname: false,
__filename: true
},
entry: './server',
externals: readExternals(),
output: {
path: './build',
filename: 'bundle.js'
},
module: {
loaders: [
{ test: /\.jade$/, loader: require.resolve('jade-loader') }
]
},
plugins: [
new webpack.BannerPlugin('module.exports = ', {raw: true, entryOnly: false})
]
};