Skip to content

Commit 787a4aa

Browse files
committed
Continued from last commit
1 parent b41dba6 commit 787a4aa

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

Diff for: package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
"type": "module",
66
"homepage": "https://bungeetaco.github.io/reconciliation/",
77
"scripts": {
8-
"dev": "vite",
9-
"build": "tsc -b && vite build",
10-
"lint": "eslint .",
11-
"preview": "vite preview",
12-
"build:github": "cross-env GITHUB_PAGES=true vite build",
13-
"deploy": "npm run build:github && gh-pages -d dist"
14-
},
8+
"dev": "vite",
9+
"build": "tsc -b && vite build", // Regular build for self-hosting
10+
"build:github": "cross-env GITHUB_PAGES=true vite build", // GitHub Pages build
11+
"lint": "eslint .",
12+
"preview": "vite preview",
13+
"deploy": "npm run build:github && gh-pages -d dist"
14+
}
1515
"dependencies": {
1616
"@radix-ui/react-slot": "^1.1.1",
1717
"class-variance-authority": "^0.7.1",

Diff for: vite.config.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,22 @@ import { defineConfig } from 'vite';
22
import react from '@vitejs/plugin-react';
33
import path from 'path';
44

5+
// Handle base URL for both GitHub Pages and self-hosting
6+
const base = process.env.GITHUB_PAGES === 'true' ? '/reconciliation/' : '/';
7+
58
export default defineConfig({
69
plugins: [react()],
710
resolve: {
811
alias: {
912
'@': path.resolve(__dirname, './src'),
1013
},
1114
},
12-
base: process.env.GITHUB_PAGES ? '/reconciliation/' : '/',
15+
base, // Use the conditional base URL
1316
build: {
1417
outDir: 'dist',
1518
assetsDir: 'assets',
16-
sourcemap: false, // Set to false for production
17-
minify: 'terser', // Use terser for better minification
19+
sourcemap: false,
20+
minify: 'terser',
1821
terserOptions: {
1922
compress: {
2023
drop_console: true,
@@ -36,13 +39,12 @@ export default defineConfig({
3639
'@/components/ui/card'
3740
]
3841
},
39-
// Ensure consistent file names
4042
entryFileNames: 'assets/[name]-[hash].js',
4143
chunkFileNames: 'assets/[name]-[hash].js',
4244
assetFileNames: 'assets/[name]-[hash].[ext]'
4345
}
4446
},
45-
chunkSizeWarningLimit: 600 // Increase warning limit if needed
47+
chunkSizeWarningLimit: 600
4648
},
4749
optimizeDeps: {
4850
include: ['react', 'react-dom', 'lodash', 'xlsx', 'papaparse', 'lucide-react']

0 commit comments

Comments
 (0)