fix to use with sveltekit

This commit is contained in:
Thiago Lagden
2023-12-11 13:34:34 -03:00
commit e14f35aff0
29 changed files with 4880 additions and 0 deletions

39
vite.config.js Normal file
View File

@@ -0,0 +1,39 @@
import {sveltekit} from '@sveltejs/kit/vite'
import {defineConfig} from 'vitest/config'
const preview = process?.env?.PREVIEW ?? false
const config = {
plugins: [sveltekit()],
test: {
include: ['tests/unit/**/*.{test,spec}.{js,ts}'],
environment: 'jsdom',
threads: false,
globals: true,
coverage: {
// prettier-ignore
include: ['src/lib/**'],
// prettier-ignore
reporter: [
'text',
'text-summary',
'lcovonly',
'cobertura'
],
},
},
build: {
sourcemap: true,
rollupOptions: {
// prettier-ignore
external: [
'quill',
],
},
},
}
if (preview) {
Reflect.deleteProperty(config, 'build')
}
export default defineConfig(config)