text: const nodeExternals = require('webpack-node-externals');
  const CopyWebpackPlugin = require('copy-webpack-plugin');
  const CompressionPlugin = require("compression-webpack-plugin");
  const path = require('path');
  
  module.exports = {
    devtool: 'source-map',
    entry: path.resolve(__dirname, 'src/index.ts'),
    target: 'node',
    node: {
      __dirname: false
    },
    externals: [nodeExternals()],
    output: {
      path: path.resolve(__dirname, 'dist'),
      filename: 'express.bundle.js',
      libraryTarget: 'commonjs2'
    },
    resolve: {
      extensions: ['.ts', '.tsx', '.js']
    },
    module: {
      rules: [
        {
          test: /\.tsx?$/,
          loader: 'ts-loader'
        }
      ]
    },
    plugins: [
      new CopyWebpackPlugin([{
        from: path.resolve(__dirname, '../my-angular4-project/dist'),
        to: 'angular'
      }]),
      new CompressionPlugin({
        asset: "[path].gz[query]",
        algorithm: "gzip",
        test: /\.(js|css)$/
      })
    ]
  };