webpack.config.js 704 B

12345678910111213141516171819202122232425262728293031323334
  1. const webpack = require('webpack');
  2. const path = require('path');
  3. const nodeExternals = require('webpack-node-externals');
  4. module.exports = {
  5. entry: ['webpack/hot/poll?1000', './modules/core/main.hmr.ts'],
  6. watch: true,
  7. target: 'node',
  8. externals: [
  9. nodeExternals({
  10. whitelist: ['webpack/hot/poll?1000'],
  11. }),
  12. ],
  13. module: {
  14. rules: [
  15. {
  16. test: /\.tsx?$/,
  17. use: 'ts-loader',
  18. exclude: /node_modules/,
  19. },
  20. ],
  21. },
  22. mode: "development",
  23. resolve: {
  24. extensions: ['.tsx', '.ts', '.js'],
  25. },
  26. plugins: [
  27. new webpack.HotModuleReplacementPlugin(),
  28. ],
  29. output: {
  30. path: path.join(__dirname, 'dist'),
  31. filename: 'server.js',
  32. },
  33. };