Skip to content

Commit 8aa4ed0

Browse files
committed
docs(guides): use HTMLWebpackPlugin in code-splitting guide
1 parent 549e4d5 commit 8aa4ed0

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

content/guides/code-splitting.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ webpack-demo
4242
|- package.json
4343
|- webpack.config.js
4444
|- /dist
45-
|- bundle.js
46-
|- index.html
4745
|- /src
4846
|- index.js
4947
+ |- another-module.js
@@ -73,7 +71,12 @@ module.exports = {
7371
output: {
7472
filename: '[name].bundle.js',
7573
path: path.resolve(__dirname, 'dist')
76-
}
74+
},
75+
plugins: [
76+
new HtmlWebpackPlugin({
77+
title: 'Code Splitting'
78+
})
79+
]
7780
};
7881
```
7982

@@ -116,11 +119,15 @@ __webpack.config.js__
116119
index: './src/index.js',
117120
another: './src/another-module.js'
118121
},
119-
+ plugins: [
122+
plugins: [
123+
new HtmlWebpackPlugin({
124+
title: 'Code Splitting'
125+
- })
126+
+ }),
120127
+ new webpack.optimize.CommonsChunkPlugin({
121128
+ name: 'common' // Specify the common bundle's name.
122129
+ })
123-
+ ],
130+
],
124131
output: {
125132
filename: '[name].bundle.js',
126133
path: path.resolve(__dirname, 'dist')
@@ -170,11 +177,15 @@ __webpack.config.js__
170177
- index: './src/index.js',
171178
- another: './src/another-module.js'
172179
},
173-
- plugins: [
180+
plugins: [
181+
new HtmlWebpackPlugin({
182+
title: 'Code Splitting'
183+
- }),
184+
+ })
174185
- new webpack.optimize.CommonsChunkPlugin({
175186
- name: 'common' // Specify the common bundle's name.
176187
- })
177-
- ],
188+
],
178189
output: {
179190
filename: '[name].bundle.js',
180191
+ chunkFilename: '[name].bundle.js',

0 commit comments

Comments
 (0)