Skip to content

Commit

Permalink
chore(vite): add dev-https script
Browse files Browse the repository at this point in the history
  • Loading branch information
nioc committed Feb 16, 2025
1 parent 9755240 commit da8683f
Show file tree
Hide file tree
Showing 5 changed files with 204 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ coverage
*.sln
*.sw?
xmpp-web.code-workspace

# Local certificates
certs/*
!certs/.gitkeep
Empty file added certs/.gitkeep
Empty file.
192 changes: 192 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"author": "nioc <dev@nioc.eu>",
"license": "AGPL-3.0-or-later",
"scripts": {
"dev": "vite --host 0.0.0.0",
"dev": "vite --host 0.0.0.0 --https false",
"dev-https": "vite --host 0.0.0.0 --https",
"build": "vite build",
"preview": "vite build && vite preview --port 8080",
"configure-git-hook": "cp docs/git-hooks/commit-msg .git/hooks/",
Expand Down Expand Up @@ -64,6 +65,7 @@
"start-server-and-test": "^2.0.10",
"vite": "^4.5.9",
"vite-plugin-istanbul": "^5.0.0",
"vite-plugin-mkcert": "^1.17.6",
"vite-plugin-pwa": "^0.14.7"
}
}
5 changes: 5 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { VitePWA } from 'vite-plugin-pwa'
import istanbul from 'vite-plugin-istanbul'
import mkcert from 'vite-plugin-mkcert'

process.env.VITE_GIT_BRANCH = require('child_process')
.execSync('git rev-parse --abbrev-ref HEAD')
Expand All @@ -23,6 +24,10 @@ export default defineConfig({
},
},
plugins: [
mkcert({
savePath: './certs',
force: true,
}),
vue(),
VitePWA({
registerType: 'autoUpdate',
Expand Down

0 comments on commit da8683f

Please # to comment.