netlify-templates / victor-hugo

Victor Hugo is a Hugo boilerplate for creating truly epic websites!
MIT License
1.53k stars 379 forks source link

How to add hash to static assets? #79

Closed shuaibird closed 5 years ago

shuaibird commented 6 years ago

It seems currently this template doesn't add a hash to static assets automatically. Not sure whether this feature has been shipped already.

erquhart commented 6 years ago

Victor Hugo currently uses Gulp for copying assets, but still using Webpack for other things. I'd like to see us use Webpack for everything, with the copy plugin for moving static assets, and a hash can be added in the copy plugin config. For example:

[
  new CopyWebpackPlugin([
    {
      from: 'src/',
      to: 'dest/[name]-[hash].[ext]',
    }
  ])
]
shuaibird commented 6 years ago

make sense. It would be much clearer to use webpack solely.

ghost commented 6 years ago

Hugo 0.43 and above now supports fingerprinting naively, Webpak not necessary

erquhart commented 6 years ago

Latest hugo-bin is 0.42, we'll get 0.43 when available.

@shuaibird agreed, we should drop gulp.

tisba commented 5 years ago

hugo is now at 0.50. Is @erquhart's usage of the copy plugin still the way to go to get fingerprinted assets?

erquhart commented 5 years ago

Hmm just noticed a recent PR updated Hugo. Assuming that didn't break anything, Hugo's native fingerprinting is now available in this starter. Docs here.