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

[FR] Support for vite.js #86

Open
applike-ss opened this issue Feb 24, 2021 · 2 comments
Open

[FR] Support for vite.js #86

applike-ss opened this issue Feb 24, 2021 · 2 comments

Comments

@applike-ss
Copy link

Hello,

i am currently trying out vite.js. Sadly i couldn't use react-spinkit with it because the browser complains:
Uncaught ReferenceError: process is not defined

This is caused by: if (!process.env.REACT_SPINKIT_NO_STYLES) {

Could you fix this or add support for vite.js?

best regards,
applike-ss

@KhoeLe
Copy link

KhoeLe commented Apr 8, 2023

I solved this problem with vite config

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  server: {
    port: 3000,
  },
  define: {
    'process.env': {
      REACT_SPINKIT_NO_STYLES: process.env.REACT_SPINKIT_NO_STYLES || false,
    },
  },

})

@LionyxML
Copy link

@KhoeLe , tks! This still works on 2023!

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

3 participants