Skip to content

Commit

Permalink
Dont run mkcert in codespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
vanpelt authored Apr 1, 2024
1 parent a5921ea commit d16092c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion frontend/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/// <reference types="vitest" />
import eslintPlugin from '@nabla/vite-plugin-eslint'
import react from '@vitejs/plugin-react'
import type { PluginOption } from 'vite'
import { defineConfig, splitVendorChunkPlugin } from 'vite'
import mkcert from 'vite-plugin-mkcert'
import { VitePWA } from 'vite-plugin-pwa'
Expand Down Expand Up @@ -35,6 +36,13 @@ const pwaPlugin = VitePWA({
}
})

const inCodespace = process.env.GITHUB_CODESPACE_TOKEN !== undefined
const plugins: PluginOption[] = [eslintPlugin()]
// Don't listen on SSL in codespaces
if (!inCodespace) {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
plugins.push(mkcert())
}
export default defineConfig(({ mode }) => ({
test: {
css: false,
Expand Down Expand Up @@ -66,6 +74,6 @@ export default defineConfig(({ mode }) => ({
tsconfigPaths(),
splitVendorChunkPlugin(),
react(),
...(mode === 'test' ? [] : [mkcert(), eslintPlugin()])
...(mode === 'test' ? [] : plugins)
]
}))

0 comments on commit d16092c

Please sign in to comment.