fix to use with sveltekit
This commit is contained in:
39
vite.config.js
Normal file
39
vite.config.js
Normal 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)
|
||||
Reference in New Issue
Block a user