(path: string, source: string)
| 190 | |
| 191 | let tsCompile: Register; |
| 192 | function compileTypeScript(path: string, source: string): string { |
| 193 | const relPath = relative(baseDir, path); |
| 194 | if (!tsCompile) { |
| 195 | tsCompile = register({ |
| 196 | basePath: workPath, // The base is the same as root now.json dir |
| 197 | project: path, // Resolve tsconfig.json from entrypoint dir |
| 198 | files: true, // Include all files such as global `.d.ts` |
| 199 | nodeVersionMajor: nodeVersion.major, |
| 200 | }); |
| 201 | } |
| 202 | const { code, map } = tsCompile(source, path); |
| 203 | tsCompiled.add(relPath); |
| 204 | preparedFiles[renameTStoJS(relPath) + '.map'] = new FileBlob({ |
| 205 | data: JSON.stringify(map), |
| 206 | }); |
| 207 | source = code; |
| 208 | shouldAddSourcemapSupport = true; |
| 209 | return source; |
| 210 | } |
| 211 | const isBun = isBunVersion(nodeVersion); |
| 212 | |
| 213 | const conditions = isEdgeFunction |
no test coverage detected