-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.ts
More file actions
76 lines (74 loc) · 1.8 KB
/
vite.config.ts
File metadata and controls
76 lines (74 loc) · 1.8 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
import path from "path"
import react from "@vitejs/plugin-react-swc"
import { defineConfig } from "vite"
import { compression } from 'vite-plugin-compression2'
import { VitePWA } from 'vite-plugin-pwa'
export default defineConfig({
plugins: [
react(
{
tsDecorators: true,
}
),
compression(
{
algorithm: "brotliCompress",
include: [".js", ".json", ".css", ".html", ".jsx", ".tsx", ".svg"]
}
),
VitePWA({
registerType: 'autoUpdate',
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg}']
},
includeAssets: ['favicon.ico'],
manifest: {
name: '9Notes - Offline-First Notes',
short_name: '9Notes',
description: 'Advanced offline-first note-taking app with rich text editor, search, and themes',
theme_color: '#3b82f6',
background_color: '#ffffff',
display: 'standalone',
scope: '/',
start_url: '/',
icons: [
{
src: 'favicon.ico',
sizes: '64x64 32x32 24x24 16x16',
type: 'image/x-icon'
}
]
}
}),
],
server: {
port: 4000,
},
base: process.env.NODE_ENV === 'production' ? '/notes/' : '/',
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
esbuild: {
tsconfigRaw: {
compilerOptions: {
experimentalDecorators: true,
},
},
},
build: {
outDir: 'dist',
assetsDir: 'assets',
sourcemap: false,
rollupOptions: {
output: {
manualChunks: {
vendor: ['react', 'react-dom', 'redux', 'react-redux'],
tiptap: ['@tiptap/core', '@tiptap/react', '@tiptap/starter-kit'],
ui: ['@radix-ui/react-dialog', '@radix-ui/react-tooltip', 'lucide-react']
}
}
}
}
})