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 = {
|
|
|
|
|
2019-07-11 22:42:03 +02:00
|
|
|
entry: ['@babel/polyfill', path.resolve(__dirname, '../server/server.js')],
|
2018-05-03 02:34:03 +02:00
|
|
|
|
|
|
|
output: {
|
2018-09-26 22:14:06 +02:00
|
|
|
path: path.resolve(__dirname, '../dist/'),
|
2018-05-03 02:34:03 +02:00
|
|
|
filename: 'server.bundle.js',
|
|
|
|
},
|
|
|
|
|
|
|
|
target: 'node',
|
2019-08-28 22:08:40 +02:00
|
|
|
mode: 'production',
|
2018-05-03 02:34:03 +02:00
|
|
|
|
|
|
|
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: {
|
2019-08-28 22:08:40 +02:00
|
|
|
rules: [
|
2018-05-03 02:34:03 +02:00
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
exclude: /node_modules/,
|
|
|
|
loader: 'babel-loader',
|
2019-06-05 18:05:31 +02:00
|
|
|
options: {
|
|
|
|
babelrc: true
|
|
|
|
}
|
2018-05-03 02:34:03 +02:00
|
|
|
}, {
|
|
|
|
test: /\.json$/,
|
|
|
|
loader: 'json-loader',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
};
|