webpack.config.js 805 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. const HtmlWebpackPlugin = require('html-webpack-plugin');
  2. const path = require('path');
  3. module.exports = {
  4. entry: './src/index.tsx',
  5. mode: 'development',
  6. resolve: {
  7. extensions: ['.ts', '.tsx', '.js', '.json']
  8. },
  9. output: {
  10. path: path.join(__dirname, '/dist'),
  11. filename: 'bundle.min.js'
  12. },
  13. module: {
  14. rules: [
  15. {
  16. test: /\.tsx?$/,
  17. use: [
  18. 'ts-loader'
  19. ]
  20. },
  21. {
  22. test: /\.scss?$/,
  23. use: [
  24. 'style-loader',
  25. 'css-loader',
  26. 'sass-loader',
  27. {
  28. loader: 'sass-resources-loader',
  29. options: { resources: './src/styles/resources.scss' }
  30. }
  31. ]
  32. }
  33. ]
  34. },
  35. plugins: [
  36. new HtmlWebpackPlugin({
  37. template: "./src/index.html"
  38. }),
  39. ]
  40. };