MCPcopy
hub / github.com/tailwindlabs/tailwindcss / createCompileOptions

Function createCompileOptions

packages/@tailwindcss-node/src/compile.ts:33–64  ·  view source on GitHub ↗
({
  base,
  from,
  polyfills,
  onDependency,
  shouldRewriteUrls,

  customCssResolver,
  customJsResolver,
}: CompileOptions)

Source from the content-addressed store, hash-verified

31}
32
33function 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
66async function ensureSourceDetectionRootExists(compiler: {
67 root: Awaited<ReturnType<typeof compile>>['root']

Callers 2

compileAstFunction · 0.85
compileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected