Change config so that the localhost certificate are to be present in the vue app folder

This commit is contained in:
2024-10-08 00:17:29 -04:00
parent 294b41d380
commit 125863537f
2 changed files with 6 additions and 3 deletions

4
.gitignore vendored
View File

@@ -1,3 +1,7 @@
# Ignore cert localhost
localhost-key.pem
localhost.pem
# Logs # Logs
logs logs
*.log *.log

View File

@@ -3,7 +3,6 @@ import {defineConfig, loadEnv} from 'vite'
import vue from '@vitejs/plugin-vue' import vue from '@vitejs/plugin-vue'
import svgLoader from 'vite-svg-loader' import svgLoader from 'vite-svg-loader'
import fs from 'fs'; import fs from 'fs';
import path from 'path';
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig(({mode}) => { export default defineConfig(({mode}) => {
@@ -16,8 +15,8 @@ export default defineConfig(({mode}) => {
], ],
server: { server: {
https: { https: {
key: fs.readFileSync(path.resolve(__dirname, 'c:/git/localhost-key.pem')), key: fs.readFileSync('localhost-key.pem'),
cert: fs.readFileSync(path.resolve(__dirname, 'c:/git/localhost.pem')), cert: fs.readFileSync('localhost.pem'),
}, },
host: 'localhost', host: 'localhost',
}, },