b2share
b2share copied to clipboard
Add support for contenthash for b2share-bundle.js building
- Use webpack 'contenthash' -variable to add id-number to
b2share-bundle.jsandb2share-bundle.js.mapfiles during webpack build. - Use webpack to inject
b2share-bundle-<CONTENTHASH>.jsdynamically toindex.html(https://github.com/EUDAT-B2SHARE/b2share/blob/d846068c71853221ac53239c9efc56e3e795e6c3/webui/app/index.html#L97)
html-webpack-plugin -webpack module could be used for 2. It supports lodash templating out-of-the-box.
v.3.2.0 seems to be the last compatible version with webpack v1 which we still use: https://github.com/jantimon/html-webpack-plugin/blob/master/CHANGELOG.md#400-2020-03-23 --> "Dropped support for Webpack 1 - 3".
See this and this for more info on templating index.html with html-webpack-plugin.
This probably would help with cache invalidation problems, where clients (i.e. browsers) won't fetch a new copy of b2share-bundle.js after webpack build.