Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Add build hash in the dist JavaScript filename #27

Open
dunnock opened this issue Mar 26, 2017 · 0 comments
Open

Add build hash in the dist JavaScript filename #27

dunnock opened this issue Mar 26, 2017 · 0 comments

Comments

@dunnock
Copy link

dunnock commented Mar 26, 2017

This will help to aviod collision with CDN where they can deliver old version of bundle if it's named the same also to be able to employ static hosting.

Can be easily done with HtmlWebpackPlugin:

  new HtmlWebpackPlugin({
    template: 'public/index.html',
    inject: false
  }),
  new ScriptExtHtmlWebpackPlugin({
    defaultAttribute: 'async'
  })

And at the bottom of public/index.html:

  <script async src="<%= htmlWebpackPlugin.files.js[0] %>"></script>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants