ts-sdk

webpack.config.prod.js 748B

12345678910111213141516171819202122232425262728293031323334
  1. /* eslint-disable @typescript-eslint/no-var-requires */
  2. const path = require('path');
  3. module.exports = {
  4. mode: 'production',
  5. entry: './src/index.ts',
  6. devtool: false,
  7. output: {
  8. filename: 'index.umd.js',
  9. path: path.resolve(__dirname, 'dist'),
  10. library: 'imSdk',
  11. libraryTarget: 'umd',
  12. },
  13. resolve: { extensions: ['.js', '.jsx', '.tsx', '.ts', '.json'] },
  14. module: {
  15. rules: [
  16. {
  17. // Include ts, tsx, js, and jsx files.
  18. test: /\.(ts|js)x?$/,
  19. exclude: /node_modules/,
  20. loader: 'babel-loader',
  21. },
  22. {
  23. test: /\.(ts|js)x?$/,
  24. loader: 'eslint-loader',
  25. options: {
  26. formatter: require('eslint-friendly-formatter'),
  27. },
  28. },
  29. ],
  30. },
  31. };