Home / Function/ importModule() — tailwindcss Function Reference

importModule() — tailwindcss Function Reference

Architecture documentation for the importModule() function in compile.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  38349b09_4bed_0163_0474_1d6bbc3d4090["importModule()"]
  b620f573_84b9_a33a_291f_6bb912350445["loadModule()"]
  b620f573_84b9_a33a_291f_6bb912350445 -->|calls| 38349b09_4bed_0163_0474_1d6bbc3d4090
  style 38349b09_4bed_0163_0474_1d6bbc3d4090 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/@tailwindcss-node/src/compile.ts lines 181–195

async function importModule(path: string): Promise<any> {
  if (typeof globalThis.__tw_load === 'function') {
    let module = await globalThis.__tw_load(path)
    if (module) {
      return module
    }
  }

  try {
    return await import(path)
  } catch (error) {
    jiti ??= createJiti(import.meta.url, { moduleCache: false, fsCache: false })
    return await jiti.import(path)
  }
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does importModule() do?
importModule() is a function in the tailwindcss codebase.
What calls importModule()?
importModule() is called by 1 function(s): loadModule.

Analyze Your Own Codebase

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

Try Supermodel Free