ts-sdk

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