This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
parserOptions
property like this: parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
plugin:@typescript-eslint/recommended
to plugin:@typescript-eslint/recommended-type-checked
or plugin:@typescript-eslint/strict-type-checked
plugin:@typescript-eslint/stylistic-type-checked
plugin:react/recommended
& plugin:react/jsx-runtime
to the extends
list/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/*.{html,js}"],
theme: {
extend: {}
},
plugins: [],
}
/** index.css */
@tailwind base;
@tailwind components;
@tailwind utilities;
npm install @supabase/supabase-js
save env variables
//.env
VITE_SUPABASE_URL=YOUR_SUPABASE_URL
VITE_SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY
create supabaseClient.ts ``` import { createClient } from '@supabase/supabase-js'
const supabaseUrl = import.meta.env.VITE_SUPABASE_URL const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY
export const supabase = createClient(supabaseUrl, supabaseAnonKey)
- generate type
- cli
- supabase gen types typescript --local > schema.gen.ts
- github actions
- create new file .github/workflows/generate-types.yml