MCPcopy
hub / github.com/vitejs/vite / constructor

Method constructor

packages/vite/src/node/build.ts:1726–1744  ·  view source on GitHub ↗
(
    name: string,
    config: ResolvedConfig,
    setup?: {
      options?: EnvironmentOptions
    },
  )

Source from the content-addressed store, hash-verified

1724
1725 isBuilt = false
1726 constructor(
1727 name: string,
1728 config: ResolvedConfig,
1729 setup?: {
1730 options?: EnvironmentOptions
1731 },
1732 ) {
1733 let options = config.environments[name]
1734 if (!options) {
1735 throw new Error(`Environment "${name}" is not defined in the config.`)
1736 }
1737 if (setup?.options) {
1738 options = mergeConfig(
1739 options,
1740 setup.options,
1741 ) as ResolvedEnvironmentOptions
1742 }
1743 super(name, config, options)
1744 }
1745
1746 async init(): Promise<void> {
1747 if (this._initiated) {

Callers

nothing calls this directly

Calls 1

mergeConfigFunction · 0.90

Tested by

no test coverage detected