ts-sdk

webpack.config.js 751B

1234567891011121314151617181920212223242526272829303132
  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: '[name].bundle.js',
  19. path: path.resolve(__dirname, 'dist')
  20. },
  21. resolve: { extensions: ['.js', '.jsx', '.tsx', '.ts', '.json'] },
  22. module: {
  23. rules: [{
  24. // Include ts, tsx, js, and jsx files.
  25. test: /\.(ts|js)x?$/,
  26. exclude: /node_modules/,
  27. loader: 'babel-loader',
  28. }],
  29. }
  30. };