-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
33 lines (30 loc) · 895 Bytes
/
vite.config.js
File metadata and controls
33 lines (30 loc) · 895 Bytes
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
import { readFileSync } from 'node:fs';
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vite';
import elmPlugin from 'vite-plugin-elm';
import { VitePWA } from 'vite-plugin-pwa';
const __dirname = dirname(fileURLToPath(import.meta.url));
const pwaManifest = JSON.parse(
readFileSync(resolve(__dirname, 'webmanifest.source.json'), 'utf-8'),
);
export default defineConfig({
plugins: [
elmPlugin(),
...VitePWA({
registerType: 'autoUpdate',
includeAssets: ['icon/*.png'],
manifest: pwaManifest,
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2,webmanifest}'],
navigateFallback: '/index.html',
},
devOptions: {
enabled: true,
},
}),
],
resolve: {
alias: [ { find: '@', replacement: resolve(__dirname, 'src') } ],
},
});