|
1 | 1 | import path from 'path'
|
2 |
| -import { pathToFileURL } from 'url' |
3 | 2 | import globby from 'globby'
|
4 | 3 | import { z } from 'zod'
|
5 | 4 | import Debug from 'debug'
|
@@ -34,15 +33,16 @@ const CT_FRAMEWORK_GLOB = path.join('node_modules', 'cypress-ct-*', 'package.jso
|
34 | 33 | // is used (e.g. module=node16). To change this, we would also have to change the ts-node behavior when requiring the
|
35 | 34 | // Cypress config file. This hack for keeping dynamic imports from being converted works across all
|
36 | 35 | // of our supported node versions
|
37 |
| -const _dynamicImport = new Function('specifier', 'return import(specifier)') |
38 | 36 |
|
39 |
| -const dynamicImport = <T>(module: string) => { |
40 |
| - return _dynamicImport(module) as Promise<T> |
41 |
| -} |
| 37 | +// const _dynamicImport = new Function('specifier', 'return import(specifier)') |
42 | 38 |
|
43 |
| -const dynamicAbsoluteImport = (filePath: string) => { |
44 |
| - return dynamicImport(pathToFileURL(filePath).href) as Promise<any> |
45 |
| -} |
| 39 | +// const dynamicImport = <T>(module: string) => { |
| 40 | +// return _dynamicImport(module) as Promise<T> |
| 41 | +// } |
| 42 | + |
| 43 | +// const dynamicAbsoluteImport = (filePath: string) => { |
| 44 | +// return dynamicImport(pathToFileURL(filePath).href) as Promise<any> |
| 45 | +// } |
46 | 46 |
|
47 | 47 | /**
|
48 | 48 | * When compiling CJS -> ESM, TS can produce:
|
@@ -94,7 +94,9 @@ export async function detectThirdPartyCTFrameworks (
|
94 | 94 |
|
95 | 95 | debug('Resolve successful: %s', modulePath)
|
96 | 96 |
|
97 |
| - const m = await dynamicAbsoluteImport(modulePath) |
| 97 | + debug('require(%s)', modulePath) |
| 98 | + |
| 99 | + const m = require(modulePath) |
98 | 100 |
|
99 | 101 | debug('Imported %o', m)
|
100 | 102 |
|
|
0 commit comments