restore frontend session
This commit is contained in:
parent
24f437cac6
commit
bc62a25a8e
11 changed files with 146 additions and 14 deletions
|
|
@ -1,12 +1,30 @@
|
|||
import { existsSync, readFileSync } from 'node:fs'
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
|
||||
import { defineConfig } from 'vite'
|
||||
import type { ServerOptions } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import vueJsx from '@vitejs/plugin-vue-jsx'
|
||||
import vueDevTools from 'vite-plugin-vue-devtools'
|
||||
|
||||
const certificateKeyPath = fileURLToPath(
|
||||
new URL('../../.cert/localhost-key.pem', import.meta.url),
|
||||
)
|
||||
const certificatePath = fileURLToPath(
|
||||
new URL('../../.cert/localhost.pem', import.meta.url),
|
||||
)
|
||||
const serverOptions: ServerOptions = {}
|
||||
|
||||
if (existsSync(certificateKeyPath) && existsSync(certificatePath)) {
|
||||
serverOptions.https = {
|
||||
key: readFileSync(certificateKeyPath),
|
||||
cert: readFileSync(certificatePath),
|
||||
}
|
||||
}
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
server: serverOptions,
|
||||
plugins: [
|
||||
vue(),
|
||||
vueJsx(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue