(loader: "ts" | "jsx" | "tsx", sourcePath?: string)
| 267 | } |
| 268 | |
| 269 | function getTransformOptions(loader: "ts" | "jsx" | "tsx", sourcePath?: string): TransformOptions { |
| 270 | switch (loader) { |
| 271 | case "ts": |
| 272 | return { |
| 273 | loader, |
| 274 | sourcefile: sourcePath, |
| 275 | tsconfigRaw: '{"compilerOptions": {"verbatimModuleSyntax": true}}' |
| 276 | }; |
| 277 | case "jsx": |
| 278 | return { |
| 279 | loader, |
| 280 | jsx: "automatic", |
| 281 | jsxImportSource: "npm:react", |
| 282 | sourcefile: sourcePath |
| 283 | }; |
| 284 | case "tsx": |
| 285 | return { |
| 286 | loader, |
| 287 | jsx: "automatic", |
| 288 | jsxImportSource: "npm:react", |
| 289 | sourcefile: sourcePath, |
| 290 | tsconfigRaw: '{"compilerOptions": {"verbatimModuleSyntax": true}}' |
| 291 | }; |
| 292 | default: |
| 293 | throw new Error(`unknown loader: ${loader}`); |
| 294 | } |
| 295 | } |
no outgoing calls
no test coverage detected