Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically inject manifest #5

Closed
insin opened this issue Jul 22, 2016 · 2 comments
Closed

Automatically inject manifest #5

insin opened this issue Jul 22, 2016 · 2 comments

Comments

@insin
Copy link

insin commented Jul 22, 2016

Would it be possible to add functionality to this plugin to have it automatically inject the manifest <script> tag into the HTML being generated?

I just wrote this plugin to inject it in my build, but it would be cool if something similar could be rolled into this plugin:

/**
 * Inject a <script> tag containing the Webpack manifest prior to HtmlPlugin
 * injecting tags for generated assets.
 */
function injectManifest() {
  this.plugin('compilation', (compilation) => {
    compilation.plugin('html-webpack-plugin-before-html-processing', (htmlPluginData, cb) => {
      let {assets, html} = htmlPluginData
      htmlPluginData.html = html.replace('</body>', `${assets.webpackManifest}</body>`)
      cb()
    })
  })
}
@bogusfocused
Copy link

I have tried to implement based on this plugin and your idea here https://github.com/rohitlodha/html-webpack-inline-chunk-plugin

@szrenwei
Copy link
Owner

szrenwei commented May 7, 2018

updated!!! please use the v4 of this plugin, sorry for update so late..

@szrenwei szrenwei closed this as completed May 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants