-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
45 lines (44 loc) · 1.11 KB
/
vite.config.ts
File metadata and controls
45 lines (44 loc) · 1.11 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
import { defineConfig } from 'vite';
import preact from '@preact/preset-vite';
import { fileURLToPath, URL } from 'node:url';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
preact(),
{
// HACK: Removes pure annotations from SignalR: https://github.com/dotnet/aspnetcore/issues/55286
name: 'remove-pure-annotations',
enforce: 'pre',
transform(code, id) {
if (id.includes('node_modules/@microsoft/signalr')) {
return code.replace(/\/\*#__PURE__\*\//g, '');
}
return null;
},
},
],
envPrefix: 'APP_',
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'@shared': fileURLToPath(new URL('./shared', import.meta.url)),
},
},
css: {
preprocessorOptions: {
scss: {
silenceDeprecations: ['import', 'global-builtin'], // HACK: milligram is outdated
},
},
},
build: {
rollupOptions: {
output: {
manualChunks: {
signalr: ['@microsoft/signalr'],
animation: ['motion', '@react-spring/web'],
},
},
},
},
});