New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable use with Vite #1402
Enable use with Vite #1402
Conversation
… replacement in vite
If at all possible, I would prefer not to add a workaround for this in OpenPGP.js. It seems like it should already be fixed in Vite? (See vitejs/vite#3801 (comment)). |
I'm going to close the PR - it seems like there is another solution. It still doesn't work when calling |
Re-opened this following the discussion here: #1332 |
@twiss Can we please bring this in? It's a minor change that will not affect current behavior with webpack at all, but will enable this to work properly in Vite. I did try to fix the issue on the Vite side, but haven't been able to do so, and don't know if/when they will fix it at all. |
Hey 👋 Sorry for the delay. I'm not a huge fan of this fix - I would prefer to move in the opposite direction, and make the substitution work correctly. One way I can think of would be to do something like: const debugMode = (() => {
try {
return process.env.NODE_ENV === 'development';
} catch (e) {}
return false;
})(); Let me know if that works for you. |
Made the adjustment and checked it with my project - looks like it works. |
👍 Thanks! |
Thanks a lot to both of you guys I will finally be able to migrate from CRA to Vite :) <3 |
Adjust the way openpgp accesses the NODE_ENV, so that it works in both webpack and vite. should close: #1332