forked from varadbhogayata/varadbhogayata.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
35 lines (33 loc) · 899 Bytes
/
vite.config.js
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
26
27
28
29
30
31
32
33
34
35
import { defineConfig } from 'vite';
import { resolve } from 'path';
import { writeFileSync } from 'fs';
import react from '@vitejs/plugin-react';
// Add a custom plugin to ensure CNAME is added to dist
const addCNAMEPlugin = () => {
return {
name: 'add-cname',
closeBundle() {
const cnamePath = resolve(__dirname, 'dist', 'CNAME');
writeFileSync(cnamePath, 'ankitgade.in');
console.log('CNAME file created!');
},
};
};
export default defineConfig({
plugins: [
react(),
addCNAMEPlugin(),
],
build: {
rollupOptions: {
input: {
index: './index.html', // Default entry point
services: './services.html',
privacyPolicy: './privacy-policy.html',
terms: './terms.html',
refundPolicy: './refund-policy.html',
},
external: ['typed.js'], // Exclude specific modules from bundling
},
},
});