Following this guide: https://stackoverflow.com/a/73465262/13176156
I tried the two options given in the answer, but they both did not work. I installed @expo\webpack-config and implemented the changes within the webpack-config.js file as shown below.
The first, changing output.hashFunction to use 'xxhash64', complained about a missing digest method.
Error: Digest method not supported
Setting experiments.futureDefaults = true gave this error:
TypeError: Cannot set properties of undefined (setting 'futureDefaults')
If anyone could help me understand why its not working and if anything can be done to use the alternate hashing algorithm that would be greatly appreciated.
Thank you.
const createExpoWebpackConfigAsync = require('@expo/webpack-config');
module.exports = async function (env, argv) {
const config = await createExpoWebpackConfigAsync(env, argv);
// Customize the config before returning it.
config.output.hashFunction = 'xxhash64';
config.experiments.futureDefaults = true;
return config;
};
CodePudding user response:
Install the xxhash-addon
for your Node.js runtime.
The implementation of its XXHash64
class satisfies the interface requirements (object must have update/digest methods) for a custom hashFunction
required by Webpack.
const createExpoWebpackConfigAsync = require('@expo/webpack-config');
module.exports = async function (env, argv) {
const config = await createExpoWebpackConfigAsync(env, argv);
// Customize the config before returning it.
config.output.hashFunction = require('xxhash-addon').XXHash64;
return config;
};