Update packages/playwright-ct-core/src/tsxTransform.ts
Co-authored-by: Pavel Feldman <pavel.feldman@gmail.com> Signed-off-by: Max Schmitt <max@schmitt.mx>
This commit is contained in:
parent
bc50a3f25d
commit
7ced290865
|
|
@ -150,7 +150,7 @@ export type ImportInfo = {
|
|||
|
||||
export function importInfo(importNode: T.ImportDeclaration, specifier: T.ImportSpecifier | T.ImportDefaultSpecifier, filename: string): { localName: string, info: ImportInfo } {
|
||||
const importSource = importNode.source.value;
|
||||
const idPrefix = (importSource.startsWith('.') ? path.join(path.dirname(filename), importSource) : importSource).replace(/[^\w_\d]/g, '_');
|
||||
const idPrefix = path.join(filename, '..', importSource).replace(/[^\w_\d]/g, '_');
|
||||
|
||||
const result: ImportInfo = {
|
||||
id: idPrefix,
|
||||
|
|
|
|||
Loading…
Reference in a new issue