Last active
April 25, 2022 17:14
-
-
Save wight554/85c2953764706f9171b4491905cf362e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference types="vitest" /> | |
import path from 'path'; | |
import preact from '@preact/preset-vite'; | |
import { defineConfig } from 'vite'; | |
import checker from 'vite-plugin-checker'; | |
import typescript from 'vite-plugin-typescript'; | |
import tsconfigPaths from 'vite-tsconfig-paths'; | |
import { configDefaults } from 'vitest/config'; | |
const isTest = process.env.NODE_ENV === 'test'; | |
// https://vitejs.dev/config/ | |
export default defineConfig({ | |
plugins: [ | |
preact({ | |
include: '{test/,}src/**/*.{ts,tsx}', | |
}), | |
tsconfigPaths(), | |
!isTest && | |
checker({ | |
typescript: { tsconfigPath: 'src/tsconfig.json' }, | |
eslint: { | |
lintCommand: 'eslint "./src/**/*.{ts,tsx}"', | |
}, | |
}), | |
isTest && typescript(), | |
], | |
build: { | |
outDir: path.join(__dirname, 'dist/public'), | |
emptyOutDir: true, | |
}, | |
test: { | |
environment: 'jsdom', | |
globals: true, | |
coverage: { | |
exclude: [...configDefaults.coverage.exclude, '**/schemas/**'], | |
}, | |
setupFiles: ['test/testSetup.ts', 'test/recoilTestSetup.ts'], | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment