-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2886 from elizaOS/tcm-client-env
fix: client server port
- Loading branch information
Showing
3 changed files
with
33 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,39 @@ | ||
import { defineConfig } from "vite"; | ||
import { defineConfig, loadEnv } from "vite"; | ||
import react from "@vitejs/plugin-react-swc"; | ||
import viteCompression from "vite-plugin-compression"; | ||
import path from "path"; | ||
|
||
// https://vite.dev/config/ | ||
export default defineConfig({ | ||
plugins: [ | ||
react(), | ||
viteCompression({ | ||
algorithm: "brotliCompress", | ||
ext: ".br", | ||
threshold: 1024, | ||
}), | ||
], | ||
clearScreen: false, | ||
envDir: path.resolve(__dirname, ".."), | ||
build: { | ||
outDir: "dist", | ||
minify: true, | ||
cssMinify: true, | ||
sourcemap: false, | ||
cssCodeSplit: true, | ||
}, | ||
resolve: { | ||
alias: { | ||
"@": "/src", | ||
export default defineConfig(({ mode }) => { | ||
const envDir = path.resolve(__dirname, ".."); | ||
const env = loadEnv(mode, envDir, ""); | ||
return { | ||
plugins: [ | ||
react(), | ||
viteCompression({ | ||
algorithm: "brotliCompress", | ||
ext: ".br", | ||
threshold: 1024, | ||
}), | ||
], | ||
clearScreen: false, | ||
envDir, | ||
define: { | ||
"import.meta.env.VITE_SERVER_PORT": JSON.stringify( | ||
env.SERVER_PORT || "3000" | ||
), | ||
}, | ||
}, | ||
build: { | ||
outDir: "dist", | ||
minify: true, | ||
cssMinify: true, | ||
sourcemap: false, | ||
cssCodeSplit: true, | ||
}, | ||
resolve: { | ||
alias: { | ||
"@": "/src", | ||
}, | ||
}, | ||
}; | ||
}); |