Home / File/ css.ts — vite Source File

css.ts — vite Source File

Architecture documentation for css.ts, a typescript file in the vite codebase. 94 imports, 9 dependents.

File typescript PluginSystem LegacySupport 94 imports 9 dependents 68 functions 2 classes

Entity Profile

Dependency Diagram

graph LR
  c3eb47df_971b_0616_6c9f_29b3ded72224["css.ts"]
  18244f7c_8357_ba88_c896_32c6447f1faf["sourcemap.ts"]
  c3eb47df_971b_0616_6c9f_29b3ded72224 --> 18244f7c_8357_ba88_c896_32c6447f1faf
  0d5a3ce6_a346_6e0c_cb12_77d5afc6444c["getCodeWithSourcemap"]
  c3eb47df_971b_0616_6c9f_29b3ded72224 --> 0d5a3ce6_a346_6e0c_cb12_77d5afc6444c
  2deecd7d_9b22_ab75_0899_d940d29c9876["injectSourcesContent"]
  c3eb47df_971b_0616_6c9f_29b3ded72224 --> 2deecd7d_9b22_ab75_0899_d940d29c9876
  a3adc511_3c03_7f25_9d76_5d3ed9987eb5["moduleGraph.ts"]
  c3eb47df_971b_0616_6c9f_29b3ded72224 --> a3adc511_3c03_7f25_9d76_5d3ed9987eb5
  fc3efa20_5545_5daf_3cf9_fa65c8365591["EnvironmentModuleNode"]
  c3eb47df_971b_0616_6c9f_29b3ded72224 --> fc3efa20_5545_5daf_3cf9_fa65c8365591
  45981d85_cbdd_e969_8c88_c17072ea0eda["build.ts"]
  c3eb47df_971b_0616_6c9f_29b3ded72224 --> 45981d85_cbdd_e969_8c88_c17072ea0eda
  c25246ea_7a11_06af_dc93_7717f85216db["createToImportMetaURLBasedRelativeRuntime"]
  c3eb47df_971b_0616_6c9f_29b3ded72224 --> c25246ea_7a11_06af_dc93_7717f85216db
  982df30b_2ec4_e822_95ff_975ea86f3b5d["resolveUserExternal"]
  c3eb47df_971b_0616_6c9f_29b3ded72224 --> 982df30b_2ec4_e822_95ff_975ea86f3b5d
  0b9e0d55_d22c_da82_ca1d_a2e7d0af1d66["toOutputFilePathInJS"]
  c3eb47df_971b_0616_6c9f_29b3ded72224 --> 0b9e0d55_d22c_da82_ca1d_a2e7d0af1d66
  d20164cd_247c_9121_2cec_43e59b542b6f["LibraryOptions"]
  c3eb47df_971b_0616_6c9f_29b3ded72224 --> d20164cd_247c_9121_2cec_43e59b542b6f
  545df65b_7f67_94d3_e2e8_a592d5e64b8f["constants.ts"]
  c3eb47df_971b_0616_6c9f_29b3ded72224 --> 545df65b_7f67_94d3_e2e8_a592d5e64b8f
  7da774f9_eca5_d54e_6e01_6bee7d460a2b["config.ts"]
  c3eb47df_971b_0616_6c9f_29b3ded72224 --> 7da774f9_eca5_d54e_6e01_6bee7d460a2b
  eb5604c2_58e1_1c00_5a1a_5d97ea5236ad["ResolvedConfig"]
  c3eb47df_971b_0616_6c9f_29b3ded72224 --> eb5604c2_58e1_1c00_5a1a_5d97ea5236ad
  5abb8c87_ffcb_f2d4_7421_e36705d9e5c7["plugin.ts"]
  c3eb47df_971b_0616_6c9f_29b3ded72224 --> 5abb8c87_ffcb_f2d4_7421_e36705d9e5c7
  style c3eb47df_971b_0616_6c9f_29b3ded72224 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import fs from 'node:fs'
import fsp from 'node:fs/promises'
import path from 'node:path'
import { fileURLToPath, pathToFileURL } from 'node:url'
import postcssrc from 'postcss-load-config'
import type {
  ExistingRawSourceMap,
  InternalModuleFormat,
  MinimalPluginContext,
  OutputAsset,
  OutputChunk,
  RenderedChunk,
  RenderedModule,
  RollupError,
  SourceMapInput,
} from 'rolldown'
import { dataToEsm } from '@rollup/pluginutils'
import colors from 'picocolors'
import MagicString from 'magic-string'
import type * as PostCSS from 'postcss'
import type Sass from 'sass'
import type Stylus from 'stylus'
import type Less from 'less'
import type { RawSourceMap } from '@jridgewell/remapping'
import { WorkerWithFallback } from 'artichokie'
import { globSync } from 'tinyglobby'
import type {
  TransformAttributeResult as LightningCssTransformAttributeResult,
  TransformResult as LightningCssTransformResult,
} from 'lightningcss'
import type { LightningCSSOptions } from '#types/internal/lightningcssOptions'
import type {
  LessPreprocessorBaseOptions,
  SassModernPreprocessBaseOptions,
  StylusPreprocessorBaseOptions,
} from '#types/internal/cssPreprocessorOptions'
import type { EsbuildTransformOptions } from '#types/internal/esbuildOptions'
import type { CustomPluginOptionsVite } from '#types/metadata'
import { getCodeWithSourcemap, injectSourcesContent } from '../server/sourcemap'
import type { EnvironmentModuleNode } from '../server/moduleGraph'
import {
  createToImportMetaURLBasedRelativeRuntime,
  resolveUserExternal,
  toOutputFilePathInCss,
  toOutputFilePathInJS,
} from '../build'
import type { LibraryOptions } from '../build'
import {
  CLIENT_PUBLIC_PATH,
  CSS_LANGS_RE,
  DEV_PROD_CONDITION,
  ESBUILD_BASELINE_WIDELY_AVAILABLE_TARGET,
  SPECIAL_QUERY_RE,
} from '../constants'
import type { ResolvedConfig } from '../config'
import type { Plugin } from '../plugin'
import { checkPublicFile } from '../publicDir'
import {
  _dirname,
  arraify,
// ... (3480 more lines)

Domain

Subdomains

Classes

Frequently Asked Questions

What does css.ts do?
css.ts is a source file in the vite codebase, written in typescript. It belongs to the PluginSystem domain, LegacySupport subdomain.
What functions are defined in css.ts?
css.ts defines 68 function(s): UrlRewritePostcssPlugin, cleanScssBugUrl, combineSourcemapsIfExists, compileCSS, compileCSSPreprocessors, compileLightningCSS, compilePostCSS, convertTargets, createCSSResolvers, createCachedImport, and 58 more.
What does css.ts depend on?
css.ts imports 94 module(s): .., ESBuildOptions, EnvironmentModuleNode, LibraryOptions, Logger, PackageCache, PartialEnvironment, Plugin, and 86 more.
What files import css.ts?
css.ts is imported by 9 file(s): config.ts, css.spec.ts, html.ts, importAnalysis.ts, importAnalysisBuild.ts, index.ts, moduleGraph.ts, rolldownDepPlugin.ts, and 1 more.
Where is css.ts in the architecture?
css.ts is located at packages/vite/src/node/plugins/css.ts (domain: PluginSystem, subdomain: LegacySupport, directory: packages/vite/src/node/plugins).

Analyze Your Own Codebase

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

Try Supermodel Free