text: const nodeExternals = require('webpack-node-externals');
  const path = require('path');
  
  const config = {
  	target: 'node',
    entry: './src/server/index.js',
    output: {
      path: path.resolve(__dirname, 'dist'),
      filename: '[name].js'
  	},
  	externals: [nodeExternals()],
    module: {
      rules: [
        {
          test: /\.jsx?$/,
          use: 'babel-loader'
        }
      ]
    } 
  };
  
  module.exports = (env, argv) => {
    if (argv.hot) {
      // Cannot use 'contenthash' when hot reloading is enabled.
      config.output.filename = '[name].[hash].js';
    }
  
    return config;
  };