index.ts — tailwindcss Source File
Architecture documentation for index.ts, a typescript file in the tailwindcss codebase. 6 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR f29c4414_c466_4d28_48df_f0e54acbee4d["index.ts"] 92f2d961_72a4_d195_92d7_2e66972f8894["node"] f29c4414_c466_4d28_48df_f0e54acbee4d --> 92f2d961_72a4_d195_92d7_2e66972f8894 134090e5_ea6f_b3c6_efa7_d9202c52de69["require-cache"] f29c4414_c466_4d28_48df_f0e54acbee4d --> 134090e5_ea6f_b3c6_efa7_d9202c52de69 8f3a837a_4918_fced_fe0d_2cfdb0bd2b31["oxide"] f29c4414_c466_4d28_48df_f0e54acbee4d --> 8f3a837a_4918_fced_fe0d_2cfdb0bd2b31 8118fcf2_a51d_d1a1_93d3_c71d3a646692["promises"] f29c4414_c466_4d28_48df_f0e54acbee4d --> 8118fcf2_a51d_d1a1_93d3_c71d3a646692 2a7660a5_3e09_bd74_37f0_e4e54bc64ce5["node:path"] f29c4414_c466_4d28_48df_f0e54acbee4d --> 2a7660a5_3e09_bd74_37f0_e4e54bc64ce5 eee339b6_0482_59a6_727c_1ec8df50b472["vite"] f29c4414_c466_4d28_48df_f0e54acbee4d --> eee339b6_0482_59a6_727c_1ec8df50b472 style f29c4414_c466_4d28_48df_f0e54acbee4d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import {
compile,
env,
Features,
Instrumentation,
normalizePath,
optimize,
toSourceMap,
} from '@tailwindcss/node'
import { clearRequireCache } from '@tailwindcss/node/require-cache'
import { Scanner } from '@tailwindcss/oxide'
import fs from 'node:fs/promises'
import path from 'node:path'
import type { Environment, Plugin, ResolvedConfig, ViteDevServer } from 'vite'
import * as vite from 'vite'
const DEBUG = env.DEBUG
const SPECIAL_QUERY_RE = /[?&](?:worker|sharedworker|raw|url)\b/
const COMMON_JS_PROXY_RE = /\?commonjs-proxy/
const INLINE_STYLE_ID_RE = /[?&]index\=\d+\.css$/
export type PluginOptions = {
/**
* Optimize and minify the output CSS.
*/
optimize?: boolean | { minify?: boolean }
}
export default function tailwindcss(opts: PluginOptions = {}): Plugin[] {
let servers: ViteDevServer[] = []
let config: ResolvedConfig | null = null
let rootsByEnv = new DefaultMap<string, Map<string, Root>>((env: string) => new Map())
let isSSR = false
let shouldOptimize = true
let minify = true
function createRoot(env: Environment | null, id: string) {
type ResolveFn = (id: string, base: string) => Promise<string | false | undefined>
let customCssResolver: ResolveFn
let customJsResolver: ResolveFn
if (!env) {
// Older, pre-environment Vite API
// TODO: Can we drop this??
let cssResolver = config!.createResolver({
...config!.resolve,
extensions: ['.css'],
mainFields: ['style'],
conditions: ['style', 'development|production'],
tryIndex: false,
preferRelative: true,
})
let jsResolver = config!.createResolver(config!.resolve)
customCssResolver = (id: string, base: string) => cssResolver(id, base, true, isSSR)
customJsResolver = (id: string, base: string) => jsResolver(id, base, true, isSSR)
} else {
// ... (395 more lines)
Domain
Subdomains
Classes
Types
Dependencies
- node
- node:path
- oxide
- promises
- require-cache
- vite
Source
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 BuildIntegrations domain, VitePlugin subdomain.
What functions are defined in index.ts?
index.ts defines 4 function(s): getExtension, idToPath, isPotentialCssRootFile, tailwindcss.
What does index.ts depend on?
index.ts imports 6 module(s): node, node:path, oxide, promises, require-cache, vite.
Where is index.ts in the architecture?
index.ts is located at packages/@tailwindcss-vite/src/index.ts (domain: BuildIntegrations, subdomain: VitePlugin, directory: packages/@tailwindcss-vite/src).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free