Repository navigation
Expand file tree
/
Copy pathvite.config.ts
More file actions
78 lines (77 loc) · 2.83 KB
/
Copy pathvite.config.ts
File metadata and controls
78 lines (77 loc) · 2.83 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import tailwindcss from '@tailwindcss/vite';
import { VitePWA } from 'vite-plugin-pwa';
import { fileURLToPath, URL } from 'node:url';
export default defineConfig({
resolve: {
alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) },
},
plugins: [
react(),
tailwindcss(),
VitePWA({
strategies: 'injectManifest',
srcDir: 'src',
filename: 'sw.ts',
registerType: 'prompt',
injectRegister: false,
injectManifest: {
globPatterns: ['**/*.{js,css,html,svg,png,webmanifest}'],
globIgnores: ['**/mediapipe/**', '**/models/**', '**/heic-to-*.js', '**/pdf.worker*', '**/ai.worker-*.js', '**/vision_bundle-*.js', '**/UTIF-*.js'],
maximumFileSizeToCacheInBytes: 6 * 1024 * 1024,
},
devOptions: { enabled: false, type: 'module' },
manifest: {
name: 'Racik — Image Tools',
short_name: 'Racik',
description: 'Kompres, ubah format, potong, sensor, hapus latar, dan perbesar gambar langsung di perangkat. Tanpa upload.',
lang: 'id',
start_url: '/',
scope: '/',
display: 'standalone',
display_override: ['window-controls-overlay', 'standalone'],
orientation: 'any',
theme_color: '#161616',
background_color: '#161616',
categories: ['photo', 'utilities', 'productivity'],
icons: [
{ src: '/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
{ src: '/icons/icon-512.png', sizes: '512x512', type: 'image/png' },
{ src: '/icons/icon-maskable-512.png', sizes: '512x512', type: 'image/png', purpose: 'maskable' },
],
share_target: {
action: '/share-target',
method: 'POST',
enctype: 'multipart/form-data',
params: { files: [{ name: 'files', accept: ['image/*', 'application/pdf'] }] },
},
file_handlers: [
{
action: '/',
accept: {
'image/*': ['.jpg', '.jpeg', '.png', '.webp', '.avif', '.gif', '.bmp', '.heic', '.heif', '.tif', '.tiff', '.svg', '.jxl', '.ico'],
},
},
],
launch_handler: { client_mode: 'focus-existing' },
} as never,
}),
],
server: { headers: { 'Cross-Origin-Opener-Policy': 'same-origin', 'Cross-Origin-Embedder-Policy': 'credentialless' } },
preview: { headers: { 'Cross-Origin-Opener-Policy': 'same-origin', 'Cross-Origin-Embedder-Policy': 'credentialless' } },
worker: { format: 'es' },
optimizeDeps: {
exclude: [
'@jsquash/jpeg',
'@jsquash/webp',
'@jsquash/avif',
'@jsquash/png',
'@jsquash/oxipng',
'@jsquash/jxl',
'@huggingface/transformers',
'onnxruntime-web',
],
},
build: { target: 'es2022', chunkSizeWarningLimit: 2000 },
});