grommet / grommet-cli

Deprecated, use create-react-app for v2 instead. Command Line interface for grommet
Apache License 2.0
28 stars 18 forks source link

Add build hash in the dist JavaScript filename #27

Open dunnock opened 7 years ago

dunnock commented 7 years ago

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>