This commit is contained in:
+3
-2
@@ -869,7 +869,7 @@ function resolve(specifier, context, nextResolve) {
|
||||
const filename = import_url.default.fileURLToPath(context.parentURL);
|
||||
const resolved = resolveHook(filename, specifier);
|
||||
if (resolved !== void 0) {
|
||||
specifier = context.conditions?.includes("import") ? import_url.default.pathToFileURL(resolved).toString() : resolved;
|
||||
specifier = new Set(context.conditions).has("import") ? import_url.default.pathToFileURL(resolved).toString() : resolved;
|
||||
}
|
||||
}
|
||||
const result2 = nextResolve(specifier, context);
|
||||
@@ -894,7 +894,8 @@ function load(moduleUrl, context, nextLoad) {
|
||||
const filename = import_url.default.fileURLToPath(moduleUrl);
|
||||
if (!shouldTransform(filename))
|
||||
return nextLoad(moduleUrl, context);
|
||||
const format = kSupportedFormats.get(context.format) || (fileIsModule(filename) ? "module" : "commonjs");
|
||||
const isRequire = !new Set(context.conditions).has("import");
|
||||
const format = isRequire ? "commonjs" : kSupportedFormats.get(context.format) || (fileIsModule(filename) ? "module" : "commonjs");
|
||||
const code = import_fs5.default.readFileSync(filename, "utf-8");
|
||||
const transformed = transformHook(code, filename, format === "module" ? moduleUrl : void 0);
|
||||
return {
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
1.2 KB packages/playwright/src/common/validators.ts
|
||||
1.3 KB packages/playwright/src/isomorphic/teleReceiver.ts
|
||||
9.6 KB packages/playwright/src/transform/compilationCache.ts
|
||||
1.6 KB packages/playwright/src/transform/esmLoaderSync.ts
|
||||
1.7 KB packages/playwright/src/transform/esmLoaderSync.ts
|
||||
1.1 KB packages/playwright/src/transform/pirates.ts
|
||||
1.1 KB packages/playwright/src/transform/portTransport.ts
|
||||
12.3 KB packages/playwright/src/transform/transform.ts
|
||||
|
||||
Reference in New Issue
Block a user