2018-05-03 02:34:03 +02:00
|
|
|
const fs = require('fs');
|
|
|
|
const path = require('path');
|
2018-05-04 02:20:40 +02:00
|
|
|
const nodeExternals = require('webpack-node-externals');
|
2018-05-03 02:34:03 +02:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
|
|
|
|
entry: path.resolve(__dirname, 'server/server.js'),
|
|
|
|
|
|
|
|
output: {
|
2018-05-04 22:36:59 +02:00
|
|
|
path: __dirname + '/dist/',
|
2018-05-03 02:34:03 +02:00
|
|
|
filename: 'server.bundle.js',
|
|
|
|
},
|
|
|
|
|
|
|
|
target: 'node',
|
|
|
|
|
|
|
|
node: {
|
|
|
|
__filename: true,
|
|
|
|
__dirname: true,
|
|
|
|
},
|
2018-05-04 02:20:40 +02:00
|
|
|
externals: [nodeExternals()],
|
2018-05-03 02:34:03 +02:00
|
|
|
|
|
|
|
resolve: {
|
2018-05-04 02:20:40 +02:00
|
|
|
extensions: ['*', '.js', '.jsx'],
|
2018-05-03 02:34:03 +02:00
|
|
|
modules: [
|
|
|
|
'client',
|
|
|
|
'node_modules',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
module: {
|
|
|
|
loaders: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
exclude: /node_modules/,
|
|
|
|
loader: 'babel-loader',
|
|
|
|
query: {
|
|
|
|
presets: [
|
|
|
|
'react',
|
2018-05-05 02:08:09 +02:00
|
|
|
'env',
|
2018-05-03 02:34:03 +02:00
|
|
|
'stage-0',
|
|
|
|
],
|
|
|
|
plugins: [
|
|
|
|
[
|
|
|
|
'babel-plugin-webpack-loaders', {
|
|
|
|
'config': './webpack.config.babel.js',
|
|
|
|
"verbose": false
|
|
|
|
}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
},
|
|
|
|
}, {
|
|
|
|
test: /\.json$/,
|
|
|
|
loader: 'json-loader',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
};
|