Insert hashed bundle URLs into static pug templates

早过忘川 提交于 2019-12-22 04:56:20

问题


I'm using Webpack pug-html-loader + file-loader to generate a bunch of static pug templates.

I also want to start added hashed bundle filenames, but I cant work out how to insert the hashed filenames into all my pug templates

This is how I'm referencing my bundle currently in all the pug templates:

script(src="bundle.js")
link(href="bundle.css")

How would I modify that to reference bundle-[chunkhash].js/bundle-[chunkhash].css] - do I need to pass some variables to the pug-html-loader in webpack.config.js?

Note: I'm using the extract-text-plugin to output my SASS to a .css bundle file

来源:https://stackoverflow.com/questions/42404303/insert-hashed-bundle-urls-into-static-pug-templates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!