webpack.config.js 869 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // const path = require("path");
  2. const HtmlWebpackPlugin = require("html-webpack-plugin");
  3. module.exports = {
  4. mode: "production",
  5. // mode:"development",
  6. entry: "./src/index.js",
  7. // entry: ['./src/a.js','./src/index.js']
  8. // entry: {
  9. // hi:"./src/a.js",
  10. // aa: "./src/index.js"
  11. // }
  12. output: {
  13. // filename:'[name]-[id]-[hash].js',
  14. // path:path.resolve(__dirname,'dist')
  15. clean: true
  16. },
  17. module: {
  18. rules: [
  19. {
  20. test: /\.css$/i,
  21. use: ['style-loader', 'css-loader'],
  22. },
  23. {
  24. test: /\.(png|svg|jpg|jpeg|gif)$/i,
  25. type: 'asset/resource',
  26. },
  27. ],
  28. },
  29. plugins:[
  30. new HtmlWebpackPlugin({ template: './src/index.html' })
  31. ],
  32. // 映射源码
  33. devtool:"inline-source-map",
  34. // 文件限制
  35. performance:{
  36. maxEntrypointSize: 5000000000,
  37. maxAssetSize: 2000000000
  38. }
  39. }