Skip to content
This repository was archived by the owner on Jun 8, 2022. It is now read-only.

Commit 67f0992

Browse files
committed
Describe override scenario
1 parent 593dfff commit 67f0992

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed

README.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,53 @@ Example template for `html-webpack-plugin`:
6363
<body>
6464
<h1>My web site</h1>
6565
<%=htmlWebpackPlugin.files.webpackChunkManifest%>
66-
<%=htmlWebpackPlugin.files.webpackManifest%>
6766
</body>
6867
</html>
6968
```
69+
70+
### Override default chunk manifest plugin
71+
To use plugins like [webpack-manifest-plugin](https://github.com/danethurber/webpack-manifest-plugin) you can override the default plugin used to extract the webpack chunk manifest. To do this, you can do either of below configs:
72+
73+
`inline-chunk-manifest-html-webpack-plugin` apply dependency plugins:
74+
```javascript
75+
const InlineChunkManifestHtmlWebpackPlugin = require('inline-chunk-manifest-html-webpack-plugin');
76+
77+
module.exports = {
78+
/* webpack config */
79+
plugins: [
80+
/* more plugins goes here */
81+
82+
new InlineChunkManifestHtmlWebpackPlugin({
83+
manifestPlugins: [
84+
new WebpackManifestPlugin()
85+
],
86+
manifestVariable: "manifest"
87+
}),
88+
new HtmlWebpackPlugin({
89+
template: './index-template.ejs'
90+
})
91+
/* more plugins goes here */
92+
]
93+
};
94+
```
95+
96+
Plugins applied separately:
97+
```javascript
98+
const InlineChunkManifestHtmlWebpackPlugin = require('inline-chunk-manifest-html-webpack-plugin');
99+
100+
module.exports = {
101+
/* webpack config */
102+
plugins: [
103+
/* more plugins goes here */
104+
new WebpackManifestPlugin(),
105+
new InlineChunkManifestHtmlWebpackPlugin({
106+
manifestVariable: "manifest",
107+
extractManifest: false
108+
}),
109+
new HtmlWebpackPlugin({
110+
template: './index-template.ejs'
111+
})
112+
/* more plugins goes here */
113+
]
114+
};
115+
```

0 commit comments

Comments
 (0)