Skip to content

Commit

Permalink
feat(projects): add port env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
locdp committed Aug 24, 2024
1 parent 3830ec7 commit 6f5ea74
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
8 changes: 7 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,11 @@ VITE_STATIC_SUPER_ROLE=R_SUPER
# sourcemap
VITE_SOURCE_MAP=N

# Used to differentiate storage across different domains
# used to differentiate storage across different domains
VITE_STORAGE_PREFIX=SOY_

# the port number on which the server is running
VITE_SERVER_PORT=9527

# the port number used for previewing the application
VITE_PREVIEW_PORT=9725
4 changes: 4 additions & 0 deletions src/typings/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ declare namespace Env {
readonly VITE_ICONIFY_URL?: string;
/** Used to differentiate storage across different domains */
readonly VITE_STORAGE_PREFIX?: string;
/** The port number on which the server is running */
readonly VITE_SERVER_PORT?: number;
/** The port number used for previewing the application */
readonly VITE_PREVIEW_PORT?: number;
}
}

Expand Down
4 changes: 2 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ export default defineConfig(configEnv => {
},
server: {
host: '0.0.0.0',
port: 9527,
port: viteEnv.VITE_SERVER_PORT || 9527,
open: true,
proxy: createViteProxy(viteEnv, enableProxy),
fs: {
cachedChecks: false
}
},
preview: {
port: 9725
port: viteEnv.VITE_PREVIEW_PORT || 9725
},
build: {
reportCompressedSize: false,
Expand Down

0 comments on commit 6f5ea74

Please sign in to comment.