Skip to content
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

Vite v4 tip #2

Open
peterrcook-canva opened this issue Jan 30, 2023 · 0 comments
Open

Vite v4 tip #2

peterrcook-canva opened this issue Jan 30, 2023 · 0 comments

Comments

@peterrcook-canva
Copy link

I was trying out Vite on another project and ran into the following error:

 template.js:38 Uncaught ReferenceError: process is not defined

which seems to occur with v4 of Vite. I just wanted to note that adding something like:

import replace from '@rollup/plugin-replace';

...
    replace({
      'process.env.NODE_ENV': JSON.stringify( 'development' )
    }),

to rollup.config.js helped. (Originally from https://blog.bitsrc.io/trying-rollup-for-react-applications-d3c2304d16bf.)

(Not sure if the above code is exactly right!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant