dcodeIO / bcrypt.js

Optimized bcrypt in plain JavaScript with zero dependencies.
Other
3.51k stars 267 forks source link

Vite: Module "crypto" has been externalized for browser compatibility #152

Open thgh opened 8 months ago

thgh commented 8 months ago

Vite 5 shows this warning:

[plugin:vite:resolve] Module "crypto" has been externalized for browser compatibility,
imported by "/.../node_modules/bcryptjs/dist/bcrypt.js".
See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility
 for more details.

I think this error would not occur if this package would use the exports field in package.json and export a browser/node version.

Yuqn commented 1 month ago

请问该怎么处理呢,我也是在浏览器出来这个警告