webpack 优化项列表

webpack性能优化

1、开发环境性能优化
2、生产环境性能优化

开发环境性能优化

1、优化打包构建速度

  • HMR 热模块更新技术
    2、优化代码调试
  • source-map 源代码到构建后代码的构建技术

生产环境性能优化

1、优化打包构建速度

  • oneOf
  • babel缓存
  • 多进程打包
  • externals
  • dll

2、优化代码运行的性能

  • 缓存(hash/chunkhash/contenthash)
  • tree shaking 过滤无用(没有使用)的代码,可以减小体积 前提:1、必须使用ES6模块化 2、开启production环境
  • code split 代码分割技术
  • 懒加载、预加载
  • PWA 渐进式 Web APP(离线加载技术)
原文地址:https://www.cnblogs.com/panghu123/p/15174001.html