webpack.ich.config.js 916 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. optimization: {
  21. minimize: false,
  22. },
  23. devtool: 'source-map',
  24. module: {
  25. rules: [
  26. {
  27. test: /\.ts$/,
  28. use: {
  29. loader: 'ts-loader',
  30. options: {
  31. configFile: 'tsconfig.ich.json',
  32. },
  33. },
  34. exclude: /node_modules/,
  35. },
  36. ],
  37. },
  38. externals: {
  39. fs: 'commonjs fs',
  40. path: 'commonjs path',
  41. },
  42. node: {
  43. __dirname: true,
  44. __filename: true,
  45. },
  46. };