( ctx: ExternalAssetContext, rawPath: string, referrerAbsDir: string, )
| 212 | } |
| 213 | |
| 214 | function tryResolveExternal( |
| 215 | ctx: ExternalAssetContext, |
| 216 | rawPath: string, |
| 217 | referrerAbsDir: string, |
| 218 | ): string | null { |
| 219 | if (isNonRelativeUrl(rawPath)) return null; |
| 220 | const absPath = resolve(referrerAbsDir, rawPath); |
| 221 | if (isPathInside(absPath, ctx.absProjectDir)) return null; |
| 222 | try { |
| 223 | if (!existsSync(absPath) || !statSync(absPath).isFile()) return null; |
| 224 | } catch { |
| 225 | return null; |
| 226 | } |
| 227 | return addExternalAsset(ctx, absPath); |
| 228 | } |
| 229 | |
| 230 | function rewriteCssUrls( |
| 231 | ctx: ExternalAssetContext, |
no test coverage detected