webpack.config.js 681 B

1234567891011121314151617181920212223242526272829
  1. const path = require('path');
  2. module.exports = {
  3. mode: 'production',
  4. // 配置打包入口
  5. // entry:'./src/hello.js',
  6. // entry: {
  7. // a:'./src/hello.js',
  8. // b:'./src/index.js'
  9. // },
  10. output: {
  11. // filename:'[name]-[id]-[hash].js'
  12. clean: true,
  13. path: path.resolve(__dirname, 'dist')
  14. },
  15. module: {
  16. rules: [
  17. {
  18. test: /\.css$/i,
  19. use: ['style-loader', 'css-loader'],
  20. },
  21. {
  22. // png|svg|jpg|jpeg|gif 区别
  23. test: /\.(png|svg|jpg|jpeg|gif)$/i,
  24. type: 'asset/resource',
  25. },
  26. ]
  27. }
  28. }