-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack-server.config.js
47 lines (39 loc) · 1.18 KB
/
webpack-server.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
46
47
//production
var webpack = require('webpack');
var path = require('path');
module.exports = {
target: 'node',
cache: false,
context: __dirname,
debug: false,
devtools: false,
entry: ["./src/server/server"],
output: {
path: path.join(__dirname, "public/server"),
filename: "server.js"
},
plugins: [
new webpack.DefinePlugin({__CLIENT__: false, __SERVER__: true}),
new webpack.DefinePlugin({"global.GENTLY": false}),
new webpack.DefinePlugin({"process.env": {NODE_ENV: '"production"'}}),
new webpack.optimize.OccurenceOrderPlugin()
],
module: {
loaders: [
{include: /\.json$/, loaders: ['json-loader']},
{include: /\.jsx$/, loaders: ['babel-loader?stage=1&optional=runtime']},
{include: /\.js$/, loaders: ['babel-loader?stage=1&optional=runtime'],
exclude: [/node_modules/, /bower_components/]}
]
},
resolve: {
extensions: ["", ".json", ".jsx", ".js"],
modulesDirectories: [
"src/server", "node_modules"
]
},
node: {
__dirname: true,
fs: 'empty'
}
}