Closed aendra-rininsland closed 5 years ago
@aendrew can your provide more information (use case, problem and etc)? Your want to use [hash]
(and etc) features?
@evilebottnawi Pretty much — my use case is that I use nunjucks-webpack-plugin
to generate static HTML templates from Nunjucks templates, and unlike html-webpack-plugin
, it seems nothing is added to the context that allows you to manually configure script tags so that they used the hashed filenames created by Webpack if you specify [hash]
or [chunkhash]
in the output filename.
For example, this is how html-webpack-plugin exposes templating globals that let you to specify how to load various hashed chunks.
@aendrew your use html-webpack-plugin
and want to integrate this plugin with html-webpack-plugin
? Or only add ability to use [hash]
(and etc). Anyway PR welcome :+1:
@evilebottnawi No, I use nunjucks-webpack-plugin for generating HTML because I have a boatload of templates that are in Nunjucks that I need to render (AFAICT there isn't any way to use Nunjucks with html-webpack-plugin
).
Will do a PR in a bit.
Raised PR for supplying compilation.hash
to templates. See https://github.com/itgalaxy/nunjucks-webpack-plugin/pull/13
@evilebottnawi can you tag and publish the next version please?
@burt202 Done in https://github.com/itgalaxy/nunjucks-webpack-plugin/releases/tag/5.0.0, can we close issue?
Im happy for it to be closed. What about @aendrew ?
Haven't had time to test but this seems like it should totally do what I'm needing. Thank you! 👍
Currently there doesn't seem to be a way of passing Webpack's filename hash/contenthash to the templates, which means it's more difficult to revision files for long-term storage.
A workaround might be to find/replace on the compiled HTML files, but really this step should probably be done at the time of template creation via nunjucks-webpack-plugin.