🚀 prepare for vercel deploy

This commit is contained in:
Danilo Znamerovszkij
2025-09-26 17:44:27 +02:00
parent 227c227657
commit ea56f4a93c
5 changed files with 66 additions and 8 deletions

2
.nvmrc
View File

@@ -1 +1 @@
22.12.0
22.19.0

View File

@@ -3,11 +3,15 @@
"private": true,
"version": "0.0.0",
"type": "module",
"engines": {
"node": ">=20.19.0"
},
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"type-check": "tsc --noEmit"
"type-check": "tsc --noEmit",
"vercel-build": "npm run build"
},
"devDependencies": {
"sass": "^1.91.0",

View File

@@ -1,9 +1,9 @@
{
"compilerOptions": {
"target": "ES2022",
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
/* Bundler mode */
@@ -15,8 +15,8 @@
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true,

44
vercel.json Normal file
View File

@@ -0,0 +1,44 @@
{
"buildCommand": "npm run build",
"outputDirectory": "dist",
"framework": "vite",
"functions": {
"app/api/**/*.js": {
"runtime": "nodejs20.x"
}
},
"rewrites": [
{
"source": "/(.*)",
"destination": "/index.html"
}
],
"headers": [
{
"source": "/assets/(.*)",
"headers": [
{
"key": "Cache-Control",
"value": "public, max-age=31536000, immutable"
}
]
},
{
"source": "/(.*)",
"headers": [
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-Frame-Options",
"value": "DENY"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
}
]
}
]
}

View File

@@ -11,14 +11,24 @@ export default defineConfig({
historyApiFallback: true
},
build: {
target: 'esnext',
target: 'es2020',
minify: 'esbuild',
sourcemap: false,
rollupOptions: {
output: {
manualChunks: {
echarts: ['echarts']
}
}
}
},
chunkSizeWarningLimit: 1000,
outDir: 'dist',
emptyOutDir: true
},
optimizeDeps: {
include: ['echarts']
},
define: {
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'production')
}
})