Skip to content

Commit 42c5f71

Browse files
authored
Update vite.config.ts
1 parent 10533c8 commit 42c5f71

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

vite.config.ts

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export default defineConfig({
77
optimizeDeps: {
88
exclude: ['lucide-react'],
99
},
10+
base: '/',
1011
server: {
1112
proxy: {
1213
// Proxy GitHub API requests to hide the actual API endpoint from clients
@@ -51,45 +52,43 @@ export default defineConfig({
5152
'Connection': 'keep-alive'
5253
},
5354
timeout: 30000
54-
},
55-
'/blockapi': {
56-
target: 'https://api.blockchain.info',
57-
changeOrigin: true,
58-
secure: false,
59-
rewrite: (path) => path.replace(/^\/blockapi/, ''),
60-
headers: {
61-
'Accept': 'application/json',
62-
'Connection': 'keep-alive'
63-
},
64-
timeout: 30000
6555
}
6656
},
6757
host: true,
68-
port: 9009
58+
port: 9000,
59+
historyApiFallback: true // Enable HTML5 history API fallback
6960
},
7061
build: {
7162
outDir: 'dist',
7263
assetsDir: 'assets',
73-
// Set base path for production deployment
74-
base: './',
64+
sourcemap: true,
65+
minify: 'terser',
7566
rollupOptions: {
7667
output: {
77-
entryFileNames: 'assets/js/[name].js',
78-
chunkFileNames: 'assets/js/[name]-[hash].js',
68+
entryFileNames: 'assets/js/[name].[hash].js',
69+
chunkFileNames: 'assets/js/[name].[hash].js',
7970
assetFileNames: (assetInfo) => {
8071
if (/\.(css)$/.test(assetInfo.name ?? '')) {
81-
return 'assets/css/[name].[ext]';
72+
return 'assets/css/[name].[hash].[ext]';
8273
}
8374
if (/\.(ico|png|jpg|jpeg|gif|svg|webp)$/.test(assetInfo.name ?? '')) {
84-
return 'assets/img/[name].[ext]';
75+
return 'assets/img/[name].[hash].[ext]';
8576
}
86-
return 'assets/[name].[ext]';
77+
return 'assets/[name].[hash].[ext]';
8778
},
8879
manualChunks: {
8980
vendor: ['react', 'react-dom', 'react-router-dom'],
81+
icons: ['lucide-react'],
82+
charts: ['recharts']
9083
},
9184
},
9285
},
86+
terserOptions: {
87+
compress: {
88+
drop_console: true,
89+
drop_debugger: true
90+
}
91+
}
9392
},
9493
publicDir: 'public',
9594
});

0 commit comments

Comments
 (0)