webpack.config.js 577 B

123456789101112131415161718192021222324252627282930
  1. const path = require('path')
  2. module.exports = {
  3. mode: 'production',
  4. // entry: [
  5. // './src/a1.js',
  6. // './src/a2.js'
  7. // ],
  8. // entry: {
  9. // hello1: './src/a1.js',
  10. // hello2: './src/a2.js'
  11. // },
  12. output: {
  13. // filename: '[name]-[id]-[hash].js',
  14. filename: 'file5.js',
  15. clean: true,
  16. // path: path.resolve(__dirname, 'hello')
  17. },
  18. module: {
  19. rules: [
  20. {
  21. test: /\.css$/,
  22. use: ['style-loader', 'css-loader']
  23. },
  24. {
  25. test: /\.(png|svg|jpg|jpeg|gif)$/i,
  26. type: 'asset/resource',
  27. }
  28. ]
  29. }
  30. }