hardcode devserver port

This commit is contained in:
Simon Knott 2024-10-23 13:18:48 +02:00
parent d1d0711a57
commit 1cb4bebdbb
2 changed files with 7 additions and 7 deletions

View file

@ -125,12 +125,12 @@ export async function installRootRedirect(server: HttpServer, traceUrls: string[
for (const reporter of options.reporter || []) for (const reporter of options.reporter || [])
params.append('reporter', reporter); params.append('reporter', reporter);
let urlPath = `./trace/${options.webApp || 'index.html'}?${params.toString()}`; let baseUrl = './trace/';
if (process.env.PW_HMR === '1') {
if (process.env.PW_WEB_DEV_SERVER) { params.set('testServerPort', '' + server.port());
params.append('testServerPort', '' + server.port()); baseUrl = 'http://localhost:44223/';
urlPath = `http://localhost:${process.env.PW_WEB_DEV_SERVER}/${options.webApp || 'index.html'}?${params.toString()}`;
} }
const urlPath = `${baseUrl}${options.webApp || 'index.html'}?${params.toString()}`;
server.routePath('/', (_, response) => { server.routePath('/', (_, response) => {
response.statusCode = 302; response.statusCode = 302;

View file

@ -307,10 +307,10 @@ steps.push({
}); });
// web packages dev server // web packages dev server
if (process.env.PW_WEB_DEV_SERVER) { if (watchMode) {
steps.push({ steps.push({
command: 'npx', command: 'npx',
args: ['vite', '--port', process.env.PW_WEB_DEV_SERVER], args: ['vite', '--port', '44223'],
shell: true, shell: true,
cwd: path.join(__dirname, '..', '..', 'packages', 'trace-viewer'), cwd: path.join(__dirname, '..', '..', 'packages', 'trace-viewer'),
concurrent: true, concurrent: true,