ts-sdk

webpack.config.js 692B

123456789101112131415161718192021222324252627282930313233343536
  1. const path = require('path');
  2. const HtmlWebpackPlugin = require('html-webpack-plugin');
  3. module.exports = {
  4. mode: 'development',
  5. entry: './example/main.ts',
  6. devtool: 'inline-source-map',
  7. devServer: {
  8. contentBase: './dist',
  9. compress: true,
  10. hot: true,
  11. },
  12. plugins: [
  13. new HtmlWebpackPlugin({
  14. title: 'index'
  15. })
  16. ],
  17. output: {
  18. filename: 'main.js',
  19. path: path.resolve(__dirname, 'dist')
  20. },
  21. module: {
  22. rules: [{
  23. test: /\.ts$/,
  24. use: "ts-loader"
  25. }]
  26. },
  27. resolve: {
  28. extensions: [
  29. '.ts',
  30. '.js',
  31. '.tsx'
  32. ]
  33. }
  34. };