Skip to content

Instantly share code, notes, and snippets.

@innocenzi
Created August 4, 2021 12:45
Show Gist options
  • Save innocenzi/f1fdd21e515ac160581c94e4b4ab2456 to your computer and use it in GitHub Desktop.
Save innocenzi/f1fdd21e515ac160581c94e4b4ab2456 to your computer and use it in GitHub Desktop.
vite-hmr-error
import { defineConfig, Plugin } from 'vite'
import vue from '@vitejs/plugin-vue'
// TODO: should be taken from environment
const certificates = {
key: 'D:\\Programmes\\Laragon\\etc\\ssl\\laragon.key',
crt: 'D:\\Programmes\\Laragon\\etc\\ssl\\laragon.crt',
}
export default defineConfig(({ command }) => ({
base: command === 'serve' ? '' : '/js/applications/calculateur-pluriannuel/dist/',
build: {
manifest: true,
rollupOptions: {
input: 'src/main.ts',
},
},
server: {
host: 'localhost',
port: 3000,
hmr: {
host: 'localhost',
port: 3000,
},
cors: true,
https: {
maxVersion: 'TLSv1.2',
...certificates,
},
},
plugins: [
vue(),
],
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment