forked from nextcloud/activity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
48 lines (46 loc) · 1.16 KB
/
vite.config.ts
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
import type { UserConfig } from 'vitest'
import { createAppConfig } from '@nextcloud/vite-config'
import { join } from 'path'
// replaced by vite
declare const __dirname: string
export default createAppConfig({
api: join(__dirname, 'src', 'api.ts'),
app: join(__dirname, 'src', 'app.ts'),
sidebar: join(__dirname, 'src', 'sidebar.js'),
personalSettings: join(__dirname, 'src', 'settings-personal.js'),
adminSettings: join(__dirname, 'src', 'settings-admin.js'),
}, {
inlineCSS: { relativeCSSInjection: true },
config: {
experimental: {
renderBuiltUrl(filename) {
return {
// already contains the "js/" prefix as it is our output file configuration
runtime: `OC.filePath('activity', '', '${filename}')`,
}
},
},
// Setup for vitest unit tests
test: {
environment: 'happy-dom',
coverage: {
all: true,
clean: true,
extension: ['.js', '.ts', '.vue'],
provider: 'v8',
},
root: 'src/',
deps: {
moduleDirectories: ['node_modules', '../node_modules'],
},
cache: {
dir: '../node_modules/.vitest',
},
server: {
deps: {
inline: [/@nextcloud\/vue/, /@mdi\/svg/],
},
},
} as UserConfig,
},
})