Skip to content
Snippets Groups Projects
Unverified Commit 3e00b32f authored by anatawa12's avatar anatawa12 Committed by GitHub
Browse files

build: port vite port configuration (#12223)

parent 0efacdfc
No related branches found
No related tags found
No related merge requests found
......@@ -253,8 +253,9 @@ export class ClientServerService {
decorateReply: false,
});
} else {
const port = (process.env.VITE_PORT ?? '5173');
fastify.register(fastifyProxy, {
upstream: 'http://localhost:5173', // TODO: port configuration
upstream: 'http://localhost:' + port,
prefix: '/vite',
rewritePrefix: '/vite',
});
......
......@@ -11,6 +11,8 @@ import { execa } from 'execa';
const _filename = fileURLToPath(import.meta.url);
const _dirname = dirname(_filename);
const vitePort = process.env.VITE_PORT ? ["--strictPort", "--port", process.env.VITE_PORT] : ["--strictPort"];
await execa('pnpm', ['clean'], {
cwd: _dirname + '/../',
stdout: process.stdout,
......@@ -41,7 +43,7 @@ execa('pnpm', ['--filter', 'backend', 'watch'], {
stderr: process.stderr,
});
execa('pnpm', ['--filter', 'frontend', 'watch'], {
execa('pnpm', ['--filter', 'frontend', 'watch', ...vitePort], {
cwd: _dirname + '/../',
stdout: process.stdout,
stderr: process.stderr,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment