diff --git a/packages/vite/src/node/build.ts b/packages/vite/src/node/build.ts index 55efd6b5398229..ea8ff1f8826af8 100644 --- a/packages/vite/src/node/build.ts +++ b/packages/vite/src/node/build.ts @@ -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' @@ -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' @@ -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'