How to inject Webpack build hash to application code

后端 未结 5 1333
花落未央
花落未央 2021-01-04 08:29

I\'m using Webpack\'s [hash] for cache busting locale files. But I also need to hard-code the locale file path to load it from browser. Since the file path is altered with [

5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-04 09:04

    The WebpackManifestPlugin is officially recommended in the output management guide. It writes a JSON to the output directory mapping the input filenames to the output filenames. Then you can inject those mapped values into your server template.

    It's similar to Dmitry's answer, except Dmitry's doesn't appear to support multiple chunks.

提交回复
热议问题