-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathvite.config.js
More file actions
25 lines (23 loc) · 848 Bytes
/
Copy pathvite.config.js
File metadata and controls
25 lines (23 loc) · 848 Bytes
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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
// Change this to match your GitHub repo name exactly
// e.g. if your repo is github.com/Neilblaze/URL-Dinogame → '/URL-Dinogame/'
const REPO_NAME = '/URL-Dinogame/';
export default defineConfig(({ command }) => ({
plugins: [react()],
// Use '/' for dev, REPO_NAME for production build
base: command === 'serve' ? '/' : REPO_NAME,
build: {
outDir: 'dist',
assetsDir: 'assets-vite',
// Prevent Vite from hashing filenames in public/ — vanilla JS files
// loaded via <script> tags need predictable names
rollupOptions: {
output: {
assetFileNames: 'assets-vite/[name]-[hash][extname]',
chunkFileNames: 'assets-vite/[name]-[hash].js',
entryFileNames: 'assets-vite/[name]-[hash].js',
},
},
},
}));