lightningcss.spec.ts — vite Source File
Architecture documentation for lightningcss.spec.ts, a typescript file in the vite codebase. 3 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 460db048_c4b0_4293_7b00_e1513d085408["lightningcss.spec.ts"] 6feed3e8_55b8_cce7_b5ef_e40b872585f7["node:url"] 460db048_c4b0_4293_7b00_e1513d085408 --> 6feed3e8_55b8_cce7_b5ef_e40b872585f7 a340ba46_b2b7_3048_3bb3_6907a74c8464["vitest"] 460db048_c4b0_4293_7b00_e1513d085408 --> a340ba46_b2b7_3048_3bb3_6907a74c8464 d3fd5575_295b_d6be_24dd_62d277645dc9["~utils"] 460db048_c4b0_4293_7b00_e1513d085408 --> d3fd5575_295b_d6be_24dd_62d277645dc9 style 460db048_c4b0_4293_7b00_e1513d085408 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { URL } from 'node:url'
import { describe, expect, test } from 'vitest'
import {
extractSourcemap,
formatSourcemapForSnapshot,
isBuild,
isServe,
page,
serverLogs,
} from '~utils'
test.runIf(isBuild)('should not output sourcemap warning (#4939)', () => {
serverLogs.forEach((log) => {
expect(log).not.toMatch('Sourcemap is likely to be incorrect')
})
})
describe.runIf(isServe)('serve', () => {
const getStyleTagContentIncluding = async (content: string) => {
const styles = await page.$$('style')
for (const style of styles) {
const text = await style.textContent()
if (text.includes(content)) {
return text
}
}
throw new Error('Not found')
}
test('linked css', async () => {
const res = await page.request.get(
new URL('./linked.css', page.url()).href,
{
headers: {
accept: 'text/css',
},
},
)
const css = await res.text()
expect(css).not.toContain('sourceMappingURL')
})
test('linked css with import', async () => {
const res = await page.request.get(
new URL('./linked-with-import.css', page.url()).href,
{
headers: {
accept: 'text/css',
},
},
)
const css = await res.text()
const map = extractSourcemap(css)
expect(formatSourcemapForSnapshot(map, css)).toMatchInlineSnapshot(`
SourceMap {
content: {
"mappings": "ACAA;;;;ADEA",
"sourceRoot": null,
"sources": [
"linked-with-import.css",
// ... (217 more lines)
Dependencies
- node:url
- vitest
- ~utils
Source
Frequently Asked Questions
What does lightningcss.spec.ts do?
lightningcss.spec.ts is a source file in the vite codebase, written in typescript.
What does lightningcss.spec.ts depend on?
lightningcss.spec.ts imports 3 module(s): node:url, vitest, ~utils.
Where is lightningcss.spec.ts in the architecture?
lightningcss.spec.ts is located at playground/css-sourcemap/__tests__/lightningcss/lightningcss.spec.ts (directory: playground/css-sourcemap/__tests__/lightningcss).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free