webpack算是个磨人的小妖精了.之前一直站在glup阵营,使用browserify打包,发现webpack已经火到爆炸,深怕被社区遗落,赶紧拿起来把玩一下.本来只想玩一下的.尝试打包了以后,就想启个webpack服务器,之后就想添加热替换,什么css文件单独拆分,各种 loader 处理优化打包结果,各种 source-map 有什么不同,一个都不能少.其中添加热替换时候,因为应用的服务器和webpack服务器没有使用同一个,产生了一点波折.然后就到了今天这个主题了. 逐步展开今天的主题:…