forked from NASA-AMMOS/aerie-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
54 lines (52 loc) · 1.46 KB
/
vite.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import { sveltekit } from '@sveltejs/kit/vite';
import svg from '@poppanator/sveltekit-svg';
import { WorkerBuildPlugin } from './vite.worker-build-plugin';
/** @type {import('vite').UserConfig} */
const config = {
build: {
minify: true,
},
css: {
devSourcemap: true,
},
plugins: [
sveltekit(),
svg({
svgoOptions: {
multipass: true,
plugins: [
{
name: 'preset-default',
// by default svgo removes the viewBox which prevents svg icons from scaling
// not a good idea! https://github.com/svg/svgo/pull/1461
params: { overrides: { removeViewBox: false } },
},
{
name: 'addClassesToSVGElement',
params: {
classNames: ['st-icon'],
},
},
],
},
}),
WorkerBuildPlugin(
['./src/workers/customTS.worker.ts', './node_modules/monaco-editor/esm/vs/language/typescript/ts.worker.js'],
{
log: true,
},
),
],
test: {
alias: [{ find: /^svelte$/, replacement: 'svelte/internal' }], // https://github.com/vitest-dev/vitest/issues/2834
environment: 'jsdom',
include: ['./src/**/*.test.ts'],
outputFile: {
html: 'unit-test-results/html-results/index.html',
json: 'unit-test-results/json-results.json',
junit: 'unit-test-results/junit-results.xml',
},
reporters: ['verbose', 'json', 'junit', 'html'],
},
};
export default config;