webpack.config.js 596 B

123456789101112131415161718192021222324
  1. module.exports = {
  2. mode:"production",
  3. //development 开发模式
  4. //none 无
  5. //production 生产模式
  6. //entry:"./src/aaa.js" 一个入口
  7. entry:[
  8. "./src/a1.js",
  9. "./src/a2.js"
  10. ],
  11. // entry:{
  12. // a1:"./src/a1.js",
  13. // a2:"./src/a2.js"
  14. // },
  15. //对象写法
  16. // output:{
  17. // filename:"newFile.js"
  18. // }
  19. output:{
  20. filename:"zzblist.js",//打包后的文件名称
  21. clean:true,//自动删除旧文件 生成新的打包文件
  22. path:path.resolve(__dirname,"dist"),//指定打包的文件
  23. }
  24. }