Home / File/ index.ts — tailwindcss Source File

index.ts — tailwindcss Source File

Architecture documentation for index.ts, a typescript file in the tailwindcss codebase. 4 imports, 0 dependents.

File typescript Oxide Scanner 4 imports 7 functions

Entity Profile

Dependency Diagram

graph LR
  23d03804_a9a2_99ea_5362_f402708f8ba3["index.ts"]
  030d452d_3c01_1d62_d32f_ba32134b0531["assets.ts"]
  23d03804_a9a2_99ea_5362_f402708f8ba3 --> 030d452d_3c01_1d62_d32f_ba32134b0531
  9e9a7c7d_f843_0850_e73b_8a417af4e602["instrumentation.ts"]
  23d03804_a9a2_99ea_5362_f402708f8ba3 --> 9e9a7c7d_f843_0850_e73b_8a417af4e602
  dca91bbb_e9eb_1bac_cbf5_45e0d5081127["Instrumentation"]
  23d03804_a9a2_99ea_5362_f402708f8ba3 --> dca91bbb_e9eb_1bac_cbf5_45e0d5081127
  a26072bf_cb87_c28a_9e44_29b7464905ec["tailwindcss"]
  23d03804_a9a2_99ea_5362_f402708f8ba3 --> a26072bf_cb87_c28a_9e44_29b7464905ec
  style 23d03804_a9a2_99ea_5362_f402708f8ba3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import * as tailwindcss from 'tailwindcss'
import * as assets from './assets'
import { Instrumentation } from './instrumentation'

/**
 * The type used by `<style>` tags that contain input CSS.
 */
const STYLE_TYPE = 'text/tailwindcss'

/**
 * The current Tailwind CSS compiler.
 *
 * This gets recreated:
 * - When stylesheets change
 */
let compiler: Awaited<ReturnType<typeof tailwindcss.compile>>

/**
 * The list of all seen classes on the page so far. The compiler already has a
 * cache of classes but this lets us only pass new classes to `build(…)`.
 */
let classes = new Set<string>()

/**
 * The last input CSS that was compiled. If stylesheets "change" without
 * actually changing, we can avoid a full rebuild.
 */
let lastCss = ''

/**
 * The stylesheet that we use to inject the compiled CSS into the page.
 */
let sheet = document.createElement('style')

/**
 * The queue of build tasks that need to be run. This is used to ensure that we
 * don't run multiple builds concurrently.
 */
let buildQueue = Promise.resolve()

/**
 * What build this is
 */
let nextBuildId = 1

/**
 * Used for instrumenting the build process. This data shows up in the
 * performance tab of the browser's devtools.
 */
let I = new Instrumentation()

/**
 * Create the Tailwind CSS compiler
 *
 * This handles loading imports, plugins, configs, etc…
 *
 * This does **not** imply that the CSS is actually built. That happens in the
 * `build` function and is a separate scheduled task.
 */
async function createCompiler() {
// ... (235 more lines)

Domain

Subdomains

Frequently Asked Questions

What does index.ts do?
index.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the Oxide domain, Scanner subdomain.
What functions are defined in index.ts?
index.ts defines 7 function(s): build, createCompiler, loadModule, loadStylesheet, observeSheet, rebuild, styleObserver.
What does index.ts depend on?
index.ts imports 4 module(s): Instrumentation, assets.ts, instrumentation.ts, tailwindcss.
Where is index.ts in the architecture?
index.ts is located at packages/@tailwindcss-browser/src/index.ts (domain: Oxide, subdomain: Scanner, directory: packages/@tailwindcss-browser/src).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free