({
base,
from,
polyfills,
onDependency,
shouldRewriteUrls,
customCssResolver,
customJsResolver,
}: CompileOptions)
| 31 | } |
| 32 | |
| 33 | function createCompileOptions({ |
| 34 | base, |
| 35 | from, |
| 36 | polyfills, |
| 37 | onDependency, |
| 38 | shouldRewriteUrls, |
| 39 | |
| 40 | customCssResolver, |
| 41 | customJsResolver, |
| 42 | }: CompileOptions) { |
| 43 | return { |
| 44 | base, |
| 45 | polyfills, |
| 46 | from, |
| 47 | async loadModule(id: string, base: string) { |
| 48 | return loadModule(id, base, onDependency, customJsResolver) |
| 49 | }, |
| 50 | async loadStylesheet(id: string, sheetBase: string) { |
| 51 | let sheet = await loadStylesheet(id, sheetBase, onDependency, customCssResolver) |
| 52 | |
| 53 | if (shouldRewriteUrls) { |
| 54 | sheet.content = await rewriteUrls({ |
| 55 | css: sheet.content, |
| 56 | root: base, |
| 57 | base: sheet.base, |
| 58 | }) |
| 59 | } |
| 60 | |
| 61 | return sheet |
| 62 | }, |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | async function ensureSourceDetectionRootExists(compiler: { |
| 67 | root: Awaited<ReturnType<typeof compile>>['root'] |
no outgoing calls
no test coverage detected