forked from freeCodeCamp/freeCodeCamp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.node.js
54 lines (52 loc) · 1.09 KB
/
webpack.config.node.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
46
47
48
49
50
51
52
53
54
var fs = require('fs');
var path = require('path');
var webpack = require('webpack');
var nodeModules = fs.readdirSync('node_modules')
.filter(function(x) {
return ['.bin'].indexOf(x) === -1;
})
.reduce(function(nodeModules, module) {
nodeModules[module] = 'commonjs ' + module;
return nodeModules;
}, {});
module.exports = {
devtool: 'sourcemap',
target: 'node',
entry: './common/app',
// keeps webpack from bundling modules
externals: nodeModules,
output: {
filename: 'app-stream.bundle.js',
path: path.join(__dirname, '/server'),
publicPath: 'public/'
},
module: {
loaders: [
{
test: /\.jsx?$/,
include: [
path.join(__dirname, 'client/'),
path.join(__dirname, 'common/')
],
loaders: [
'babel-loader'
]
},
{
test: /\.json$/,
loaders: [
'json-loader'
]
}
]
},
plugins: [
new webpack.BannerPlugin(
'require("source-map-support").install();',
{
raw: true,
entryOnly: false
}
)
]
};