Home / Function/ createPreprocessorWorkerController() — vite Function Reference

createPreprocessorWorkerController() — vite Function Reference

Architecture documentation for the createPreprocessorWorkerController() function in css.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  1da538be_8fb3_3d85_2856_d9bfecfb04f5["createPreprocessorWorkerController()"]
  c3eb47df_971b_0616_6c9f_29b3ded72224["css.ts"]
  1da538be_8fb3_3d85_2856_d9bfecfb04f5 -->|defined in| c3eb47df_971b_0616_6c9f_29b3ded72224
  157cb972_609e_022e_1ec5_3ed6f7e4f45c["cssPlugin()"]
  157cb972_609e_022e_1ec5_3ed6f7e4f45c -->|calls| 1da538be_8fb3_3d85_2856_d9bfecfb04f5
  4c8f6d74_d3d3_58db_32d0_15e3a669dc14["preprocessCSS()"]
  4c8f6d74_d3d3_58db_32d0_15e3a669dc14 -->|calls| 1da538be_8fb3_3d85_2856_d9bfecfb04f5
  0a163673_dac2_220c_2b8a_a489f9a38632["scssProcessor()"]
  1da538be_8fb3_3d85_2856_d9bfecfb04f5 -->|calls| 0a163673_dac2_220c_2b8a_a489f9a38632
  b115d8d2_4bdd_4a69_c76d_1789ff11d443["lessProcessor()"]
  1da538be_8fb3_3d85_2856_d9bfecfb04f5 -->|calls| b115d8d2_4bdd_4a69_c76d_1789ff11d443
  158d0e42_28ce_8bd3_13df_1f08b6dbf23f["stylProcessor()"]
  1da538be_8fb3_3d85_2856_d9bfecfb04f5 -->|calls| 158d0e42_28ce_8bd3_13df_1f08b6dbf23f
  562e9e2b_e379_c47c_c40f_7b7850f80d38["close()"]
  1da538be_8fb3_3d85_2856_d9bfecfb04f5 -->|calls| 562e9e2b_e379_c47c_c40f_7b7850f80d38
  style 1da538be_8fb3_3d85_2856_d9bfecfb04f5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/plugins/css.ts lines 3131–3157

const createPreprocessorWorkerController = (maxWorkers: number | undefined) => {
  const scss = scssProcessor(maxWorkers)
  const less = lessProcessor(maxWorkers)
  const styl = stylProcessor(maxWorkers)

  const sassProcess: StylePreprocessor<SassStylePreprocessorInternalOptions>['process'] =
    (environment, source, root, options, resolvers) => {
      const opts: SassStylePreprocessorInternalOptions = { ...options }
      opts.syntax = 'indented'
      return scss.process(environment, source, root, opts, resolvers)
    }

  const close = () => {
    less.close()
    scss.close()
    styl.close()
  }

  return {
    [PreprocessLang.less]: less.process,
    [PreprocessLang.scss]: scss.process,
    [PreprocessLang.sass]: sassProcess,
    [PreprocessLang.styl]: styl.process,
    [PreprocessLang.stylus]: styl.process,
    close,
  } as const satisfies Record<PreprocessLang | 'close', unknown>
}

Domain

Subdomains

Frequently Asked Questions

What does createPreprocessorWorkerController() do?
createPreprocessorWorkerController() is a function in the vite codebase, defined in packages/vite/src/node/plugins/css.ts.
Where is createPreprocessorWorkerController() defined?
createPreprocessorWorkerController() is defined in packages/vite/src/node/plugins/css.ts at line 3131.
What does createPreprocessorWorkerController() call?
createPreprocessorWorkerController() calls 4 function(s): close, lessProcessor, scssProcessor, stylProcessor.
What calls createPreprocessorWorkerController()?
createPreprocessorWorkerController() is called by 2 function(s): cssPlugin, preprocessCSS.

Analyze Your Own Codebase

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

Try Supermodel Free