You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

webpack.js 932B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. const path = require('path');
  2. const frontendConf = {
  3. mode: 'production',
  4. target: "web",
  5. entry: path.resolve(__dirname, 'TestFrontend.ts'),
  6. output: {
  7. path: path.resolve(__dirname, '..'),
  8. filename: "TestFrontend.js",
  9. libraryTarget: 'commonjs',
  10. },
  11. module: {
  12. rules: [
  13. { test: /\.ts?$/, loader: "ts-loader" }
  14. ]
  15. },
  16. resolve: {
  17. extensions: [".ts", ".tsx", ".js"]
  18. },
  19. optimization: {
  20. minimize: true,
  21. },
  22. }
  23. const backendConf = {
  24. mode: 'production',
  25. target: "node",
  26. entry: path.resolve(__dirname, 'TestBackend.ts'),
  27. output: {
  28. path: path.resolve(__dirname, '..'),
  29. filename: "TestBackend.js",
  30. libraryTarget: 'commonjs',
  31. },
  32. module: {
  33. rules: [
  34. { test: /\.ts?$/, loader: "ts-loader" }
  35. ]
  36. },
  37. resolve: {
  38. extensions: [".ts", ".tsx", ".js"]
  39. },
  40. optimization: {
  41. minimize: false,
  42. },
  43. }
  44. module.exports = [backendConf, frontendConf]