Skip to content

Commit

Permalink
Added SSL for the local development server
Browse files Browse the repository at this point in the history
This helps to test some features like the geolocation on device mobile
which requires ssl (at least on iphone).
  • Loading branch information
ltshb committed Aug 12, 2024
1 parent 4328560 commit db97e47
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DS_Store
node_modules
dist/
devServer/

# local env files
.env.local
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
"@rushstack/eslint-patch": "^1.10.4",
"@types/jsdom": "^21.1.7",
"@types/node": "^18.19.43",
"@vitejs/plugin-basic-ssl": "^1.1.0",
"@vitejs/plugin-vue": "^5.1.2",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^13.0.0",
Expand Down
12 changes: 12 additions & 0 deletions vite.config.mts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import basicSsl from '@vitejs/plugin-basic-ssl'
import vue from '@vitejs/plugin-vue'
import gitDescribe from 'git-describe'
import { dirname, resolve } from 'path'
Expand Down Expand Up @@ -50,6 +51,17 @@ export default defineConfig(({ mode }) => {
},
},
plugins: [
{
...basicSsl({
/** Name of certification */
name: 'localhost',
/** Custom trust domains */
domains: ['localhost', '192.168.*.*'],
/** Custom certification directory */
certDir: './devServer/cert',
}),
apply: 'serve',
},
vue({
isProduction: mode === 'production',
template: {
Expand Down

0 comments on commit db97e47

Please sign in to comment.