Skip to content

Commit 9248b73

Browse files
committed
remove fancy copy
1 parent 86d9e78 commit 9248b73

1 file changed

Lines changed: 1 addition & 26 deletions

File tree

vite.config.ts

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,10 @@
11
import { defineConfig } from 'vite'
22
import react from '@vitejs/plugin-react'
33
import tailwindcss from '@tailwindcss/vite'
4-
import * as fs from 'node:fs'
5-
import * as path from 'node:path'
64

75
// https://vite.dev/config/
86
export default defineConfig({
9-
plugins: [
10-
react(),
11-
tailwindcss(),
12-
// Plugin to copy index.html to 404.html for GitHub Pages SPA routing
13-
{
14-
name: 'copy-index-to-404',
15-
closeBundle() {
16-
try {
17-
const distPath = path.resolve('dist')
18-
const indexPath = path.join(distPath, 'index.html')
19-
const notFoundPath = path.join(distPath, '404.html')
20-
21-
if (fs.existsSync(indexPath)) {
22-
fs.copyFileSync(indexPath, notFoundPath)
23-
// eslint-disable-next-line no-console
24-
console.log('✅ Copied index.html to 404.html for GitHub Pages SPA routing')
25-
}
26-
} catch (error) {
27-
// eslint-disable-next-line no-console
28-
console.warn('⚠️ Failed to copy index.html to 404.html:', error)
29-
}
30-
}
31-
}
32-
],
7+
plugins: [react(), tailwindcss()],
338
base: '/', // Set to '/' since we'll use a custom domain
349
build: {
3510
outDir: 'dist',

0 commit comments

Comments
 (0)