Skip to content

Commit

Permalink
Made the ssl optional
Browse files Browse the repository at this point in the history
  • Loading branch information
ltshb committed Aug 12, 2024
1 parent db97e47 commit 0f0f087
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
13 changes: 13 additions & 0 deletions package-lock.json

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

6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
"preview:dev": "npm run build:dev && vite preview --port 8080 --host --outDir dist/development",
"preview:int": "npm run build:int && vite preview --mode integration --port 8080 --host --outDir dist/integration",
"preview:prod": "npm run build:prod && vite preview --mode production --port 8080 --host --outDir dist/production",
"dev:https": "USE_HTTPS=1 npm run dev",
"int:https": "USE_HTTPS=1 npm run int",
"prod:https": "USE_HTTPS=1 npm run prod",
"preview:dev:https": "USE_HTTPS=1 npm run preview:dev",
"preview:int:https": "USE_HTTPS=1 npm run preview:int",
"preview:prod:https": "USE_HTTPS=1 npm run preview:prod",
"lint": "eslint . --fix --ignore-path .gitignore --ext .js,.vue",
"lint:no-fix": "eslint . --ignore-path .gitignore --ext .js,.vue",
"test:unit": "npm run delete:reports:unit && vitest --run --mode development --environment jsdom",
Expand Down
18 changes: 10 additions & 8 deletions vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,16 @@ export default defineConfig(({ mode }) => {
},
plugins: [
{
...basicSsl({
/** Name of certification */
name: 'localhost',
/** Custom trust domains */
domains: ['localhost', '192.168.*.*'],
/** Custom certification directory */
certDir: './devServer/cert',
}),
...(process.env.USE_HTTPS
? basicSsl({
/** Name of certification */
name: 'localhost',
/** Custom trust domains */
domains: ['localhost', '192.168.*.*'],
/** Custom certification directory */
certDir: './devServer/cert',
})
: {}),
apply: 'serve',
},
vue({
Expand Down

0 comments on commit 0f0f087

Please sign in to comment.