@@ -42,8 +42,6 @@ webpack-demo
42
42
|- package.json
43
43
|- webpack.config.js
44
44
|- /dist
45
- |- bundle.js
46
- |- index.html
47
45
|- /src
48
46
|- index.js
49
47
+ |- another-module.js
@@ -73,7 +71,12 @@ module.exports = {
73
71
output: {
74
72
filename: ' [name].bundle.js' ,
75
73
path: path .resolve (__dirname , ' dist' )
76
- }
74
+ },
75
+ plugins: [
76
+ new HtmlWebpackPlugin ({
77
+ title: ' Code Splitting'
78
+ })
79
+ ]
77
80
};
78
81
```
79
82
@@ -116,11 +119,15 @@ __webpack.config.js__
116
119
index: './src/index.js',
117
120
another: './src/another-module.js'
118
121
},
119
- + plugins: [
122
+ plugins: [
123
+ new HtmlWebpackPlugin({
124
+ title: 'Code Splitting'
125
+ - })
126
+ + }),
120
127
+ new webpack.optimize.CommonsChunkPlugin({
121
128
+ name: 'common' // Specify the common bundle's name.
122
129
+ })
123
- + ],
130
+ ],
124
131
output: {
125
132
filename: '[name].bundle.js',
126
133
path: path.resolve(__dirname, 'dist')
@@ -170,11 +177,15 @@ __webpack.config.js__
170
177
- index: './src/index.js',
171
178
- another: './src/another-module.js'
172
179
},
173
- - plugins: [
180
+ plugins: [
181
+ new HtmlWebpackPlugin({
182
+ title: 'Code Splitting'
183
+ - }),
184
+ + })
174
185
- new webpack.optimize.CommonsChunkPlugin({
175
186
- name: 'common' // Specify the common bundle's name.
176
187
- })
177
- - ],
188
+ ],
178
189
output: {
179
190
filename: '[name].bundle.js',
180
191
+ chunkFilename: '[name].bundle.js',
0 commit comments