Skip to content

Commit dd8de19

Browse files
committed
Ensure CNAME file is included in build output
1 parent 1e05f45 commit dd8de19

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

vite.config.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1-
import { defineConfig } from 'vite'
1+
import { defineConfig } from 'vite';
2+
import { resolve } from 'path';
3+
import { copyFileSync } from 'fs';
4+
5+
// Copy CNAME file to dist after build
6+
const copyCNAME = () => {
7+
return {
8+
name: 'copy-cname',
9+
closeBundle() {
10+
copyFileSync(resolve(__dirname, 'CNAME'), resolve(__dirname, 'dist', 'CNAME'));
11+
},
12+
};
13+
};
214

315
export default defineConfig({
416
base: '/port/', // updated to match repository name
5-
})
17+
plugins: [copyCNAME()],
18+
});

0 commit comments

Comments
 (0)