When I use webpack to build, I want to save the hash value in a global variable so that the js of other modules can be called. I tried configuring it. Only putting it in the file name, such as output: 'a[hash].js', will have the effect. But this is not saved in the global variable and the js in the project cannot be called. I tried putting it in new webpack.DefinePlugin but I couldn’t get the hash value. Please give me some advice.
I just looked at the documentation and source code, can you provide me with an idea
You want to get the
[name].[hash].bundle.js
set in output.filename.You can try TemplatedPathPlugin or extend TemplatedPathPlugin.