webpack.config.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. const { IgnorePlugin } = require('webpack');
  2. const CopyWebpackPlugin = require('copy-webpack-plugin');
  3. const path = require('path');
  4. module.exports = {
  5. entry: './src/app.ts',
  6. // devtool: 'inline-source-map',
  7. module: {
  8. rules: [
  9. {
  10. test: /\.tsx?$/,
  11. use: 'ts-loader',
  12. exclude: /node_modules/,
  13. },
  14. ],
  15. },
  16. resolve: {
  17. extensions: ['.js', '.tsx', '.ts' ],
  18. alias: {
  19. "@src": path.resolve(__dirname, "src"),
  20. "@root": path.resolve(__dirname, "../"),
  21. "@classes": path.resolve(__dirname, "../base-lib/src/classes/"),
  22. "@core": path.resolve(__dirname, "../base-lib/src/core/"),
  23. "@util": path.resolve(__dirname, "../base-lib/src/util/"),
  24. "@core-models": path.resolve(__dirname, "../base-lib/src/core-models/"),
  25. "@core-guards": path.resolve(__dirname, "../base-lib/src/core-guards/")
  26. },
  27. fallback: {
  28. "_stream_transform": false
  29. }
  30. },
  31. target: 'node',
  32. externals:{
  33. "fs": "commonjs fs",
  34. "net": "commonjs net"
  35. },
  36. plugins: [
  37. new IgnorePlugin({
  38. resourceRegExp: /^pg-native$/,
  39. }),
  40. new CopyWebpackPlugin({
  41. patterns: [
  42. {from: 'config.json'},
  43. ]
  44. })
  45. ],
  46. output: {
  47. filename: 'index.js',
  48. path: path.resolve(__dirname, '../__dist/pmr-access-control'),
  49. },
  50. optimization: {
  51. minimize: false
  52. }
  53. };