mirror of
https://github.com/supabase/supabase.git
synced 2026-10-15 14:19:11 +03:00
* add supabase assets url to urlImports * rm unnecessary comment * add download script * clean up + jsr supabasejs script * rm unused jsr-url const * Exclude the *.ts files in public folder from tsconfig. * Add the base path when fetching the type definitions. --------- Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import react from '@vitejs/plugin-react'
|
|
import path, { resolve } from 'path'
|
|
import { fileURLToPath } from 'url'
|
|
import tsconfigPaths from 'vite-tsconfig-paths'
|
|
import { defineConfig } from 'vitest/config'
|
|
|
|
// Some tools like Vitest VSCode extensions, have trouble with resolving relative paths,
|
|
// as they use the directory of the test file as `cwd`, which makes them believe that
|
|
// `setupFiles` live next to the test file itself. This forces them to always resolve correctly.
|
|
const dirname = fileURLToPath(new URL('.', import.meta.url))
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
react(),
|
|
tsconfigPaths({
|
|
projects: ['.'],
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@ui': path.resolve(__dirname, './../../packages/ui/src'),
|
|
},
|
|
},
|
|
test: {
|
|
globals: true,
|
|
environment: 'jsdom', // TODO(kamil): This should be set per test via header in .tsx files only
|
|
include: [resolve(dirname, './**/*.test.{ts,tsx}')],
|
|
restoreMocks: true,
|
|
setupFiles: [
|
|
resolve(dirname, './tests/vitestSetup.ts'),
|
|
resolve(dirname, './tests/setup/polyfills.js'),
|
|
resolve(dirname, './tests/setup/radix.js'),
|
|
],
|
|
},
|
|
})
|