@@ -7,9 +7,9 @@ var webpack = require("webpack");
77//utility1
88//utility2
99//utility3
10- //pageA = polyfill + utility1 + utility2
11- //pageB = polyfill + utility2 + utility3
12- //pageC = polyfill + utility2 + utility3
10+ //pageA = polyfill + jQuery + underscore + utility1 + utility2
11+ //pageB = polyfill + jQuery + underscore + utility2 + utility3
12+ //pageC = polyfill + jQuery + underscore + utility2 + utility3
1313
1414module . exports = {
1515 entry : {
@@ -60,7 +60,7 @@ module.exports = {
6060 // plugins: [
6161 // new webpack.optimize.CommonsChunkPlugin({
6262 // //顺序很重要
63- // //If an array of strings is passed this is equal to invoking the plugin multiple times for each chunk name.
63+ // //If an array of strings is passed this is equal to invoking the plugin multiple times for each chunk name.
6464 // //common.js用于至少被2个entry都使用的公共模块,即common.js = polyfill + utility2.js + utility3.js
6565 // //init.js用于存储webpack runtime的代码,即init.js = webpack runtime
6666 // names: ["common", "init"],
@@ -93,6 +93,7 @@ module.exports = {
9393
9494 //http://stackoverflow.com/questions/35908253/webpack-how-to-bundle-entries-to-multiple-common-chunks-with-commonschunkplugin
9595 plugins : [
96+ //vender不经常变化,为了使用缓存,通过指定chunks把它单独弄出来,init包含webpack runtime和其他公共模块
9697 new webpack . optimize . CommonsChunkPlugin ( {
9798 name : "vendor" ,
9899 chunks : [ "vendor" ]
0 commit comments