Skip to content

Commit 0121970

Browse files
add relative path to entry points
1 parent a3715e8 commit 0121970

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/rollwright/fixture.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { resolve, dirname, basename } from "node:path";
1+
import { resolve, dirname, basename, join, relative } from "node:path";
22

33
import { test as base } from "@playwright/test";
44

@@ -67,7 +67,8 @@ async function execute({ page, rlcache, plugins, template, extensions, coverage
6767
let hash = `step_${++id}`;
6868
let code = `window.${hash} = ${fn.toString()};`;
6969
let rootDir = dirname(testInfo.file);
70-
let input = `${hash}_${basename(testInfo.file)}`;
70+
let relativePath = dirname(relative(process.cwd(), testInfo.file));
71+
let input = join(relativePath, `${hash}_${basename(testInfo.file)}`);
7172
inputs.push(input);
7273
files.push(ephemeral(input, code));
7374
let bundle = await rollup({
@@ -123,6 +124,7 @@ async function execute({ page, rlcache, plugins, template, extensions, coverage
123124
let params = [entry.fileName, hash, args];
124125
return await page.evaluateHandle(([src, hash, args]) => {
125126
return new Promise((resolve, reject) => {
127+
/* globals window, document */
126128
let onload = () => resolve(window[hash](...args));
127129
let onerror = () => reject();
128130
let script = document.createElement("script");

packages/rollwright/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rollwright",
3-
"version": "0.0.5",
3+
"version": "0.0.6",
44
"type": "module",
55
"main": "./fixture.js",
66
"module": "./fixture.js",

0 commit comments

Comments
 (0)