2019-03-20 15:28:18 -05:00
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
const nodeExternals = require('webpack-node-externals');
|
|
|
|
const StartServerPlugin = require('start-server-webpack-plugin');
|
|
|
|
|
|
|
|
const config = require('./webpack.common.config');
|
|
|
|
|
|
|
|
config.entry = {
|
|
|
|
server: [
|
|
|
|
'source-map-support/register',
|
|
|
|
'@babel/polyfill',
|
|
|
|
path.join(__dirname, 'register-traits.js'),
|
2019-03-20 22:23:26 -05:00
|
|
|
path.join(__dirname, 'server', 'index.js'),
|
2019-03-20 15:28:18 -05:00
|
|
|
],
|
|
|
|
};
|
|
|
|
config.externals = [
|
|
|
|
nodeExternals({
|
|
|
|
whitelist: /@avocado/,
|
|
|
|
}),
|
|
|
|
];
|
|
|
|
config.plugins.push(new StartServerPlugin({
|
|
|
|
name: 'server.js',
|
|
|
|
restartable: false,
|
|
|
|
}));
|
|
|
|
config.target = 'node';
|
|
|
|
|
|
|
|
module.exports = config;
|