File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
tutorials/webpack-common-chunk Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,9 @@ var webpack = require("webpack");
7
7
//utility1
8
8
//utility2
9
9
//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
13
13
14
14
module . exports = {
15
15
entry : {
@@ -60,7 +60,7 @@ module.exports = {
60
60
// plugins: [
61
61
// new webpack.optimize.CommonsChunkPlugin({
62
62
// //顺序很重要
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.
64
64
// //common.js用于至少被2个entry都使用的公共模块,即common.js = polyfill + utility2.js + utility3.js
65
65
// //init.js用于存储webpack runtime的代码,即init.js = webpack runtime
66
66
// names: ["common", "init"],
@@ -93,6 +93,7 @@ module.exports = {
93
93
94
94
//http://stackoverflow.com/questions/35908253/webpack-how-to-bundle-entries-to-multiple-common-chunks-with-commonschunkplugin
95
95
plugins : [
96
+ //vender不经常变化,为了使用缓存,通过指定chunks把它单独弄出来,init包含webpack runtime和其他公共模块
96
97
new webpack . optimize . CommonsChunkPlugin ( {
97
98
name : "vendor" ,
98
99
chunks : [ "vendor" ]
You can’t perform that action at this time.
0 commit comments