at-import.test.ts — tailwindcss Source File
Architecture documentation for at-import.test.ts, a typescript file in the tailwindcss codebase. 9 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 4df2701b_a89e_8fd1_9f94_60320aab09a9["at-import.test.ts"] da5d1116_ab2a_437a_6b13_c1429fd546fa["plugin-api.ts"] 4df2701b_a89e_8fd1_9f94_60320aab09a9 --> da5d1116_ab2a_437a_6b13_c1429fd546fa aace5133_6deb_d0f7_e1a1_d3e530878a5b["Plugin"] 4df2701b_a89e_8fd1_9f94_60320aab09a9 --> aace5133_6deb_d0f7_e1a1_d3e530878a5b 23bd4e2f_c62c_a942_7014_8486569053ee["index.ts"] 4df2701b_a89e_8fd1_9f94_60320aab09a9 --> 23bd4e2f_c62c_a942_7014_8486569053ee c59be670_b950_e897_c2ef_f6a86119dcc3["compile"] 4df2701b_a89e_8fd1_9f94_60320aab09a9 --> c59be670_b950_e897_c2ef_f6a86119dcc3 914a5326_dcdd_e839_bbc4_d6545cf4c5d5["plugin.ts"] 4df2701b_a89e_8fd1_9f94_60320aab09a9 --> 914a5326_dcdd_e839_bbc4_d6545cf4c5d5 f9b7eac1_3b10_a208_408b_b98998a33868["run.ts"] 4df2701b_a89e_8fd1_9f94_60320aab09a9 --> f9b7eac1_3b10_a208_408b_b98998a33868 28c8c12b_7bfb_c956_c83b_681f0ac38ee2["optimizeCss"] 4df2701b_a89e_8fd1_9f94_60320aab09a9 --> 28c8c12b_7bfb_c956_c83b_681f0ac38ee2 8ff4bb92_b963_efb6_cca2_1da4b3ea849b["dedent"] 4df2701b_a89e_8fd1_9f94_60320aab09a9 --> 8ff4bb92_b963_efb6_cca2_1da4b3ea849b f1e05e5f_c1b2_a3f5_b2e8_3317b9243ac3["vitest"] 4df2701b_a89e_8fd1_9f94_60320aab09a9 --> f1e05e5f_c1b2_a3f5_b2e8_3317b9243ac3 style 4df2701b_a89e_8fd1_9f94_60320aab09a9 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import dedent from 'dedent'
import { expect, test, vi } from 'vitest'
import type { Plugin } from './compat/plugin-api'
import { compile, type Config } from './index'
import plugin from './plugin'
import { optimizeCss } from './test-utils/run'
const css = dedent
async function run(
css: string,
{
loadStylesheet = () => Promise.reject(new Error('Unexpected stylesheet')),
loadModule = () => Promise.reject(new Error('Unexpected module')),
candidates = [],
optimize = true,
}: {
loadStylesheet?: (
id: string,
base: string,
) => Promise<{ content: string; base: string; path: string }>
loadModule?: (
id: string,
base: string,
resourceHint: 'plugin' | 'config',
) => Promise<{ module: Config | Plugin; base: string; path: string }>
candidates?: string[]
optimize?: boolean
},
) {
let compiler = await compile(css, { base: '/root', loadStylesheet, loadModule })
let result = compiler.build(candidates)
return optimize ? optimizeCss(result) : result
}
test('can resolve relative @imports', async () => {
let loadStylesheet = async (id: string, base: string) => {
expect(base).toBe('/root')
expect(id).toBe('./foo/bar.css')
return {
content: css`
.foo {
color: red;
}
`,
base: '/root/foo',
path: '',
}
}
await expect(
run(
css`
@import './foo/bar.css';
`,
{ loadStylesheet },
),
).resolves.toMatchInlineSnapshot(`
".foo {
color: red;
// ... (577 more lines)
Domain
Subdomains
Functions
Dependencies
Source
Frequently Asked Questions
What does at-import.test.ts do?
at-import.test.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 at-import.test.ts?
at-import.test.ts defines 2 function(s): loadStylesheet, run.
What does at-import.test.ts depend on?
at-import.test.ts imports 9 module(s): Plugin, compile, dedent, index.ts, optimizeCss, plugin-api.ts, plugin.ts, run.ts, and 1 more.
Where is at-import.test.ts in the architecture?
at-import.test.ts is located at packages/tailwindcss/src/at-import.test.ts (domain: Oxide, subdomain: Scanner, directory: packages/tailwindcss/src).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free