KyleAMathews / react-spinkit

A collection of loading indicators animated with CSS for React
http://kyleamathews.github.io/react-spinkit/
MIT License
1.49k stars 73 forks source link

[FR] Support for vite.js #86

Open applike-ss opened 3 years ago

applike-ss commented 3 years ago

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 commented 1 year ago

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 commented 11 months ago

@KhoeLe , tks! This still works on 2023!