( pluginContext: PluginContext, url: string, importer: string, forceInline?: boolean, )
| 510 | } |
| 511 | |
| 512 | export async function urlToBuiltUrl( |
| 513 | pluginContext: PluginContext, |
| 514 | url: string, |
| 515 | importer: string, |
| 516 | forceInline?: boolean, |
| 517 | ): Promise<string> { |
| 518 | const topLevelConfig = pluginContext.environment.getTopLevelConfig() |
| 519 | if (checkPublicFile(url, topLevelConfig)) { |
| 520 | return publicFileToBuiltUrl(url, topLevelConfig) |
| 521 | } |
| 522 | const file = normalizePath( |
| 523 | url[0] === '/' |
| 524 | ? path.join(topLevelConfig.root, url) |
| 525 | : path.join(path.dirname(importer), url), |
| 526 | ) |
| 527 | return fileToBuiltUrl( |
| 528 | pluginContext, |
| 529 | file, |
| 530 | // skip public check since we just did it above |
| 531 | true, |
| 532 | forceInline, |
| 533 | ) |
| 534 | } |
| 535 | |
| 536 | function shouldInline( |
| 537 | environment: Environment, |
no test coverage detected