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