-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.config-server.js
More file actions
70 lines (58 loc) · 1.61 KB
/
webpack.config-server.js
File metadata and controls
70 lines (58 loc) · 1.61 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*eslint-disable*/
var webpack = require('webpack');
var path = require('path');
var fs = require('fs');
// http://jlongster.com/Backend-Apps-with-Webpack--Part-I
// pentru falcor-router / hapijs:
// copiez rx-3.1.2 in node_modules din falcor-router
var nodeModules = {};
fs.readdirSync('node_modules')
.filter(function(x) {
return ['.bin'].indexOf(x) === -1;
})
.forEach(function(mod) {
nodeModules[mod] = 'commonjs ' + mod;
});
module.exports = {
target: 'node',
cache: true,
context: __dirname,
debug: true,
devtools: "source-map",
entry: ["./runtime/server/server.js"],
// resolve: {
// alias: {
// 'rx$': require.resolve('rx/dist/rx')
// }
// },
output: {
path: path.join(__dirname, "dist/server"),
filename: "server.js"
},
// externals: nodeModules, // http://jlongster.com/Backend-Apps-with-Webpack--Part-I
plugins: [
new webpack.DefinePlugin({__CLIENT__: false, __SERVER__: true}),
new webpack.DefinePlugin({"global.GENTLY": false}),
new webpack.DefinePlugin({ 'ENV.browser': false }),
// new webpack.optimize.DedupePlugin(),
// new webpack.optimize.OccurenceOrderPlugin(),
// new webpack.optimize.UglifyJsPlugin()
],
module: {
loaders: [
{include: /\.json$/, loaders: ['json-loader']},
{include: /\.js$/, loaders: ['babel-loader?stage=1&optional=runtime'],
exclude: [/node_modules/, /bower_components/]}
]
},
resolve: {
extensions: ["", ".json", ".jsx", ".js"],
modulesDirectories: [
"server", "node_modules"
]
},
node: {
__dirname: true,
fs: 'empty'
}
}