24 lines
599 B
TypeScript
24 lines
599 B
TypeScript
import { defineConfig } from 'vite';
|
|
import vue from '@vitejs/plugin-vue';
|
|
import { readFileSync } from 'node:fs';
|
|
import { homedir } from 'node:os';
|
|
import { join } from 'node:path';
|
|
|
|
const certDir = join(homedir(), 'mac.biboer.cn_ecc');
|
|
const httpsCert = readFileSync(join(certDir, 'fullchain.cer'));
|
|
const httpsKey = readFileSync(join(certDir, 'mac.biboer.cn.key'));
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
server: {
|
|
host: '0.0.0.0',
|
|
port: 5173,
|
|
strictPort: true,
|
|
allowedHosts: ['mac.biboer.cn'],
|
|
https: {
|
|
cert: httpsCert,
|
|
key: httpsKey
|
|
}
|
|
}
|
|
});
|