File tree Expand file tree Collapse file tree 4 files changed +17
-10
lines changed
Expand file tree Collapse file tree 4 files changed +17
-10
lines changed Original file line number Diff line number Diff line change 1+ import { MkcertPluginOptions } from "vite-plugin-mkcert" ;
2+
3+ export const securedDomainConfigured = process . env . VITE_APP_DOMAIN && process . env . VITE_ENABLE_MKCERT_SSL ;
4+
5+ export const securedDomainHosts = securedDomainConfigured
6+ ? [ "localhost" , process . env . VITE_APP_DOMAIN ] . filter ( Boolean )
7+ : [ "localhost" ] ;
8+
9+ export const mkcertConfig : MkcertPluginOptions = {
10+ hosts : securedDomainHosts as string [ ] ,
11+ } ;
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ export default defineConfig({
6767 /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
6868 use : {
6969 /* Base URL to use in actions like `await page.goto('/')`. */
70- baseURL : "https ://localhost:8000" ,
70+ baseURL : "http ://localhost:8000" ,
7171
7272 /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
7373 trace : "on" ,
Original file line number Diff line number Diff line change 44 "skipLibCheck" : true ,
55 "module" : " ESNext" ,
66 "moduleResolution" : " bundler" ,
7- "allowSyntheticDefaultImports" : true
7+ "allowSyntheticDefaultImports" : true ,
8+ "strict" : true
89 },
9- "include" : [" vite.config.ts" ,
10- " fixReactVirtualized.ts" ]
10+ "include" : [" vite.config.ts" ," fixReactVirtualized.ts" ," mkcert.util.ts" ]
1111}
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { viteStaticCopy } from "vite-plugin-static-copy";
99import svgr from "vite-plugin-svgr" ;
1010
1111import { reactVirtualized } from "./fixReactVirtualized" ;
12+ import { securedDomainConfigured , mkcertConfig } from "./mkcert.util" ;
1213
1314dotenv . config ( ) ;
1415
@@ -87,12 +88,7 @@ export default defineConfig({
8788 } ,
8889 plugins : [
8990 react ( ) ,
90- mkcert ( {
91- hosts :
92- process . env . VITE_DISABLE_MKCERT_SSL === "true" && process . env . VITE_APP_DOMAIN
93- ? [ "localhost" ]
94- : [ "localhost" , process . env . VITE_APP_DOMAIN ] . filter ( Boolean ) ,
95- } ) ,
91+ ...( securedDomainConfigured ? [ mkcert ( mkcertConfig ) ] : [ ] ) ,
9692 ViteEjsPlugin ( ( viteConfig ) => ( {
9793 env : viteConfig . env ,
9894 } ) ) ,
You can’t perform that action at this time.
0 commit comments