Skip to content

Commit 171977f

Browse files
committed
Fix (MIME type issues for Github Pages)
1 parent ef03262 commit 171977f

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
- name: Build 🔧
2424
run: npm run build
2525

26+
- name: Create .nojekyll file 📄
27+
run: touch dist/.nojekyll
28+
2629
- name: Deploy 🚀
2730
uses: JamesIves/github-pages-deploy-action@v4
2831
with:

.nojekyll

Whitespace-only changes.

vite.config.js

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,28 @@ import path from 'path';
66
export default defineConfig({
77
plugins: [react()],
88

9-
base: '/',
9+
// For GitHub Pages deployment
10+
base: '/hxndev.github.io/', // Use your repository name
1011

1112
build: {
1213
outDir: 'dist',
1314
sourcemap: true,
15+
rollupOptions: {
16+
output: {
17+
manualChunks: {
18+
react: ['react', 'react-dom'],
19+
mantine: ['@mantine/core', '@mantine/hooks'],
20+
},
21+
},
22+
},
1423
},
1524

1625
// Add alias for better imports
1726
resolve: {
1827
alias: {
1928
'@': path.resolve(__dirname, './src'),
2029
},
30+
extensions: ['.js', '.jsx', '.json'],
2131
},
2232

2333
// Public directory configuration
@@ -27,13 +37,16 @@ export default defineConfig({
2737
server: {
2838
port: 3000,
2939
open: true,
30-
// Handles image request paths correctly
31-
proxy: {
32-
'/hxndev.github.io': {
33-
target: 'http://localhost:3000',
34-
changeOrigin: true,
35-
rewrite: (path) => path.replace(/^\/hxndev\.github\.io/, '')
36-
}
37-
}
38-
}
40+
host: true,
41+
},
42+
43+
// Optimize deps
44+
optimizeDeps: {
45+
include: ['react', 'react-dom', '@mantine/core', 'gsap'],
46+
},
47+
48+
// Ensure proper MIME types for JavaScript modules
49+
esbuild: {
50+
jsxInject: `import React from 'react'`,
51+
},
3952
});

0 commit comments

Comments
 (0)