humus-old/webpack.server.config.js

34 lines
780 B
JavaScript
Raw Normal View History

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'),
'@avocado/behavior/item/initialize',
path.join(__dirname, 'server', 'index.js'),
2019-03-20 15:28:18 -05:00
],
};
config.externals = [
nodeExternals({
whitelist: /@avocado/,
}),
];
2019-04-12 13:44:56 -05:00
const nodeArgs = [];
if (process.argv.find((arg) => '--prof' === arg)) {
nodeArgs.push('--prof');
}
2019-03-20 15:28:18 -05:00
config.plugins.push(new StartServerPlugin({
name: 'server.js',
2019-04-12 13:44:56 -05:00
nodeArgs: nodeArgs,
2019-03-20 15:28:18 -05:00
restartable: false,
}));
config.target = 'node';
module.exports = config;