webpack.ich.config.js 847 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import path from 'path';
  2. import { fileURLToPath } from 'url';
  3. const __filename = fileURLToPath(import.meta.url);
  4. const __dirname = path.dirname(__filename);
  5. export default {
  6. entry: './scripts/ExportToAi/ich.ts',
  7. target: 'node',
  8. mode: 'production',
  9. output: {
  10. path: path.resolve(__dirname, 'dist'),
  11. filename: 'ich-bundle.cjs',
  12. clean: true,
  13. },
  14. resolve: {
  15. extensions: ['.ts', '.js'],
  16. alias: {
  17. '@': path.resolve(__dirname),
  18. }
  19. },
  20. module: {
  21. rules: [
  22. {
  23. test: /\.ts$/,
  24. use: {
  25. loader: 'ts-loader',
  26. options: {
  27. configFile: 'tsconfig.ich.json',
  28. },
  29. },
  30. exclude: /node_modules/,
  31. },
  32. ],
  33. },
  34. externals: {
  35. fs: 'commonjs fs',
  36. path: 'commonjs path',
  37. },
  38. node: {
  39. __dirname: true,
  40. __filename: true,
  41. },
  42. };