Home / Function/ testEnvQueryParamsPlugin() — vite Function Reference

testEnvQueryParamsPlugin() — vite Function Reference

Architecture documentation for the testEnvQueryParamsPlugin() function in vite.config.js from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  d30f634a_380b_f8b3_c51b_0f79a35f4b27["testEnvQueryParamsPlugin()"]
  a6f59069_6070_6880_416d_9e8c0b0817c9["vite.config.js"]
  d30f634a_380b_f8b3_c51b_0f79a35f4b27 -->|defined in| a6f59069_6070_6880_416d_9e8c0b0817c9
  style d30f634a_380b_f8b3_c51b_0f79a35f4b27 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

playground/define/vite.config.js lines 6–25

function testEnvQueryParamsPlugin() {
  let isBuild = true
  return {
    name: 'test-env-query-params',
    configResolved(config) {
      isBuild = config.command === 'build'
    },
    transform(code, id) {
      if (
        id.includes('index.html') &&
        code.includes('__VITE_ENV_WITH_QUERY__')
      ) {
        return code.replace(
          '__VITE_ENV_WITH_QUERY__',
          JSON.stringify(isBuild ? 'data:text/javascript,' : '/@vite/env?foo'),
        )
      }
    },
  }
}

Domain

Subdomains

Frequently Asked Questions

What does testEnvQueryParamsPlugin() do?
testEnvQueryParamsPlugin() is a function in the vite codebase, defined in playground/define/vite.config.js.
Where is testEnvQueryParamsPlugin() defined?
testEnvQueryParamsPlugin() is defined in playground/define/vite.config.js at line 6.

Analyze Your Own Codebase

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

Try Supermodel Free