Filename hash will be affected
See original GitHub issueWhen the following options are enabled, contenthash will be affected and failed to load chunks. (Webpack 5)
const path = require("path");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const WebpackObfuscator = require("webpack-obfuscator");
module.exports = {
mode: "production",
output: {
path: path.resolve(__dirname, "dist"),
filename: "[name].js",
// chunkFilename: "[name].[chunkhash:8].js", // ✅
chunkFilename: "[name].[contenthash:8].js", // ❌
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin(),
new WebpackObfuscator(
{
splitStrings: true,
splitStringsChunkLength: 5,
stringArray: true,
stringArrayEncoding: ["rc4"],
stringArrayIndexShift: true,
stringArrayWrappersCount: 5,
stringArrayWrappersChainedCalls: true,
stringArrayWrappersParametersMaxCount: 5,
stringArrayWrappersType: "function",
stringArrayThreshold: 1,
},
[]
),
],
};
Reproduce repo: https://github.com/sxzz/webpack-obfuscator-test
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Does the hash of a file change if the filename changes?
The hash of a file is the hash of its contents. Metadata such as the file name, timestamps, permissions, etc. have no influence...
Read more >Will changing a file name affect the MD5 Hash of a file?
No, the hash is of the file contents only. You can see this in the source for md5sum and its MD5 implementation. You...
Read more >Adding Hashes to Filenames - SurviveJS
Including hashes related to the file contents to their names allows to invalidate them on the client-side. If a hash has changed, the...
Read more >Hash changes if a filename is changed · Issue #1479 - GitHub
I'm unable to get this working with the webpack-md5-hash plugin at all, I still get different hash names on my files for the...
Read more >File Name Hashing: Creating a Hashed Directory Structure
Most modern file systems do not limit the number of files you can store in a single directory. However, depending on the type...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Released as
3.3.0
. Please try it.I don’t know if this change could produce any side-effects, so please let me know if you found any problems