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

Commit

Permalink
Describe override scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
jouni-kantola committed Apr 19, 2017
1 parent 593dfff commit 67f0992
Showing 1 changed file with 47 additions and 1 deletion.
48 changes: 47 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,53 @@ Example template for `html-webpack-plugin`:
<body>
<h1>My web site</h1>
<%=htmlWebpackPlugin.files.webpackChunkManifest%>
<%=htmlWebpackPlugin.files.webpackManifest%>
</body>
</html>
```

### Override default chunk manifest plugin
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:

`inline-chunk-manifest-html-webpack-plugin` apply dependency plugins:
```javascript
const InlineChunkManifestHtmlWebpackPlugin = require('inline-chunk-manifest-html-webpack-plugin');

module.exports = {
/* webpack config */
plugins: [
/* more plugins goes here */

new InlineChunkManifestHtmlWebpackPlugin({
manifestPlugins: [
new WebpackManifestPlugin()
],
manifestVariable: "manifest"
}),
new HtmlWebpackPlugin({
template: './index-template.ejs'
})
/* more plugins goes here */
]
};
```

Plugins applied separately:
```javascript
const InlineChunkManifestHtmlWebpackPlugin = require('inline-chunk-manifest-html-webpack-plugin');

module.exports = {
/* webpack config */
plugins: [
/* more plugins goes here */
new WebpackManifestPlugin(),
new InlineChunkManifestHtmlWebpackPlugin({
manifestVariable: "manifest",
extractManifest: false
}),
new HtmlWebpackPlugin({
template: './index-template.ejs'
})
/* more plugins goes here */
]
};
```

0 comments on commit 67f0992

Please sign in to comment.