Open Cellule opened 8 months ago
require.resolve is only supported by webpack. When trying to migrate to Vite preprocessor with cypress-vite I hit error that require doesn't exists. https://github.com/abhinaba-ghosh/cypress-react-selector/blob/1c552942900f9ce24bf93a5ca996392957ac461f/src/resqInjector.js#L8-L11
require.resolve
require
I initially tried to add typeof require !== "undefined" but vite transforms it making the check useless. I'm not sure what is a good solution, for now on my side I simply patched away the require.resolve call and use the hardcoded path
typeof require !== "undefined"
require.resolve
is only supported by webpack. When trying to migrate to Vite preprocessor with cypress-vite I hit error thatrequire
doesn't exists. https://github.com/abhinaba-ghosh/cypress-react-selector/blob/1c552942900f9ce24bf93a5ca996392957ac461f/src/resqInjector.js#L8-L11I initially tried to add
typeof require !== "undefined"
but vite transforms it making the check useless. I'm not sure what is a good solution, for now on my side I simply patched away therequire.resolve
call and use the hardcoded path