Skip to content

Commit

Permalink
fix: do not init optimizer during build (#15727)
Browse files Browse the repository at this point in the history
Co-authored-by: Senao <[email protected]>
  • Loading branch information
patak-dev and XiSenao authored Jan 27, 2024
1 parent 3fceb14 commit a08f646
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions packages/vite/src/node/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import type { RollupCommonJSOptions } from 'dep-types/commonjs'
import type { RollupDynamicImportVarsOptions } from 'dep-types/dynamicImportVars'
import type { TransformOptions } from 'esbuild'
import type { InlineConfig, ResolvedConfig } from './config'
import { isDepsOptimizerEnabled, resolveConfig } from './config'
import { resolveConfig } from './config'
import { buildReporterPlugin } from './plugins/reporter'
import { buildEsbuildPlugin } from './plugins/esbuild'
import { type TerserOptions, terserPlugin } from './plugins/terser'
Expand All @@ -41,7 +41,6 @@ import type { Logger } from './logger'
import { dataURIPlugin } from './plugins/dataUri'
import { buildImportAnalysisPlugin } from './plugins/importAnalysisBuild'
import { ssrManifestPlugin } from './ssr/ssrManifestPlugin'
import { initDepsOptimizer } from './optimizer'
import { loadFallbackPlugin } from './plugins/loadFallback'
import { findNearestPackageData } from './packages'
import type { PackageCache } from './packages'
Expand Down Expand Up @@ -524,10 +523,6 @@ export async function build(
ssr ? config.plugins.map((p) => injectSsrFlagToHooks(p)) : config.plugins
) as Plugin[]

if (isDepsOptimizerEnabled(config, ssr)) {
await initDepsOptimizer(config)
}

const rollupOptions: RollupOptions = {
preserveEntrySignatures: ssr
? 'allow-extension'
Expand Down

0 comments on commit a08f646

Please sign in to comment.