Open vitalyiegorov opened 4 years ago
Hi @vitalyiegorov,
Excuse me for the delay, please.
Could you try to redefine a getId
option in reselector.config
in case of your project, please?
You can find the implementation example here: https://github.com/lttb/reselector/blob/29e4c7c509b45fe9eb4d124b67de7757fbf4c168/src/utils.js#L135-L136
For example,
reslector.config.js
const stringHash = require('string-hash')
module.exports = {
// options
getId(filename, name) {
return stringHash(/* your case of getting the monorepo identifier for file and component name */).toString(16)
}
}
I'm not sure why your example with projectPath
doesn't work, but I think an experiment with getId
might be a good starting point
Hi @lttb, thanks for this great library, we are perfectly using it in our unit tests but I need your help with the following issue:
We have a monorepo project with webdriverio e2e tests, and we cannot use this selectors in our e2e tests because they generate different hashes for the components, how we can improve to generate same hashes independently of cwd, because for example react-app is started from
/project/web/
and e2e is started from/e2e/web/
I have tried changing
parentPath
fromutils.js
with env variable:But this does not solves the issue, please guide me though the logic so I could make a PR.