forked from MaskingTechnology/comify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
52 lines (49 loc) · 1.28 KB
/
vite.config.ts
File metadata and controls
52 lines (49 loc) · 1.28 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
import jitar, { JitarConfig } from '@jitar/plugin-vite';
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import { VitePWA } from 'vite-plugin-pwa';
import tsconfigPaths from 'vite-tsconfig-paths';
const JITAR_URL = 'http://localhost:3000';
const JITAR_SEGMENTS = [];
const JITAR_MIDDLEWARES = ['./integrations/runtime/requesterMiddleware'];
const jitarConfig: JitarConfig = {
sourceDir: 'src',
targetDir: 'dist',
jitarDir: 'domain',
jitarUrl: JITAR_URL,
segments: JITAR_SEGMENTS,
middleware: JITAR_MIDDLEWARES
};
export default defineConfig({
publicDir: 'src/webui/public',
build: {
assetsDir: 'webui',
emptyOutDir: false
},
plugins: [
react(),
VitePWA({
strategies: 'generateSW',
manifest: false,
workbox: {
additionalManifestEntries:
[
{ url: '/manifest.webmanifest', revision: null }
],
globPatterns: ['index.html', 'registerSW.js', 'assets/*', 'webui/**/*.{js,css,html,png,svg}']
},
}),
{
name: 'add-manifest-link',
transformIndexHtml(html)
{
return html.replace(
'</head>',
'<link rel="manifest" href="/manifest.webmanifest"></head>'
);
}
},
tsconfigPaths(),
jitar(jitarConfig)
]
});