Unexpected token process.env.NODE_ENV
Closed this issue · 3 comments
ShuCh3n commented
I'm currently using Vite, but during rollup im getting an unexpected token error. This is regarding the warning text in file create-checkout-service.ts on line 95.
getDefaultLogger().warn(
'Note that the development build is not optimized. To create a production build, set process.env.NODE_ENV to `production`.',
);
When I remove the "process.env.NODE_ENV" text it will build just fine.
bc-peng commented
Could you kindly provide your question?
animesh1987 commented
Hey @ShuCh3n are you building SDK locally for dev? Where are you removing the text from?
ShuCh3n commented
@animesh1987 It Doesn't matter for which build, either dev or production both are giving me this error. I suspect that Vite replaces the process.env.NODE_ENV. So when I remove this part of text in node_modules/@bigcommerce/checkout-sdk/dist/checkout-sdk.js it will build just fine.