webpack.config.js 851 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. const path = require('path');
  2. var modules_path = path.resolve(__dirname, './bin');
  3. module.exports = {
  4. target: 'web',
  5. // devtool: 'inline-source-map',
  6. entry: './src/JSEncrypt.ts',
  7. output: {
  8. filename: 'jsencrypt.js',
  9. chunkFilename: 'modules/[chunkhash].[name].chunk.js',
  10. path: modules_path,
  11. strictModuleExceptionHandling: true
  12. },
  13. resolve: {
  14. // Add `.ts` and `.tsx` as a resolvable extension.
  15. extensions: ['.ts', '.tsx', '.js']
  16. },
  17. module: {
  18. rules: [
  19. // all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
  20. {
  21. test: /\.tsx?$/,
  22. use: [
  23. {
  24. loader: 'ts-loader',
  25. options: {
  26. transpileOnly: false,
  27. configFile: require.resolve("./tsconfig.json")
  28. }
  29. },
  30. ]
  31. },
  32. ]
  33. },
  34. };