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 || [])
params.append('reporter', reporter);
let urlPath = `./trace/${options.webApp || 'index.html'}?${params.toString()}`;
if (process.env.PW_WEB_DEV_SERVER) {
params.append('testServerPort', '' + server.port());
urlPath = `http://localhost:${process.env.PW_WEB_DEV_SERVER}/${options.webApp || 'index.html'}?${params.toString()}`;
let baseUrl = './trace/';
if (process.env.PW_HMR === '1') {
params.set('testServerPort', '' + server.port());
baseUrl = 'http://localhost:44223/';
}
const urlPath = `${baseUrl}${options.webApp || 'index.html'}?${params.toString()}`;
server.routePath('/', (_, response) => {
response.statusCode = 302;

View file

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