-
-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathvite.config.ts
More file actions
63 lines (61 loc) · 1.76 KB
/
vite.config.ts
File metadata and controls
63 lines (61 loc) · 1.76 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
54
55
56
57
58
59
60
61
62
63
import { defineConfig } from 'vitest/config'
import vue from '@vitejs/plugin-vue'
// Get vite port from env, default to 3000
const vitePort = parseInt(process.env.VITE_PORT || '5173', 10)
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
],
server: {
host: true, // Allows external access (needed for Docker)
strictPort: true,
port: vitePort,
origin: `http://localhost:${vitePort}`,
},
root: 'app/assets/',
base: '/assets/',
build: {
outDir: '../../public/assets',
assetsDir: '',
emptyOutDir: true,
manifest: true,
rollupOptions: {
input: {
main: 'app/assets/main.ts',
search: 'app/assets/search.ts'
}
}
},
// Fix uikit path issue
// @see : https://github.com/uikit/uikit/issues/5024
css: {
preprocessorOptions: {
less: {
relativeUrls: 'all'
}
}
},
// Force optimization of UiKit and limax (not module packages) in dev mode
// to avoid the error:
// "importing binding name 'default' cannot be resolved by star export entries"
// Also, treat all sprinkles as source code (not prebuilt) and tell Vite
// not to prebundle them.
optimizeDeps: {
include: ['uikit', 'uikit/dist/js/uikit-icons']
},
test: {
environment: 'happy-dom',
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html', 'lcov'],
reportsDirectory: '../../_meta/frontend-coverage',
exclude: [
'main.ts',
'highlight.js',
'search.ts',
'**/*.spec.ts',
],
}
}
})