-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathvite.config.ts
More file actions
53 lines (50 loc) Β· 1.43 KB
/
vite.config.ts
File metadata and controls
53 lines (50 loc) Β· 1.43 KB
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
/* eslint-disable no-console */
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vitest/config';
import faroUploader from '@grafana/faro-rollup-plugin';
import devtoolsJson from 'vite-plugin-devtools-json';
if (process.env.FARO_UPLOAD_SOURCE_MAPS_KEY) {
console.log('π - FARO_UPLOAD_SOURCE_MAPS_KEY is set, enabling source map upload');
} else {
console.log('π - FARO_UPLOAD_SOURCE_MAPS_KEY is not set, skipping source map upload');
}
const config = defineConfig(({ mode }) => ({
plugins: [
devtoolsJson(),
sveltekit(),
process.env.FARO_UPLOAD_SOURCE_MAPS_KEY
? faroUploader({
appName: 'app',
endpoint: 'https://faro-api-prod-eu-west-2.grafana.net/faro/api/v1',
appId: '2936',
stackId: '1238676',
apiKey: process.env.FARO_UPLOAD_SOURCE_MAPS_KEY,
gzipContents: true,
})
: undefined,
],
test: {
// Jest like globals
globals: true,
environment: 'jsdom',
include: ['src/**/*.{test,spec}.ts'],
exclude: ['src/e2e-tests/.tmp/**'],
setupFiles: ['./setup-test.js'],
testTimeout: 7000,
},
resolve: {
conditions: mode === 'unit-test' ? ['browser'] : undefined,
alias: {
// Required for octokit.
'node-fetch': 'isomorphic-fetch',
},
},
preview: {
host: '0.0.0.0',
},
server: {
// required for local env
allowedHosts: ['app'],
},
}));
export default config;