{"record":{"id":"9f81a9bd0d0ab6ab","repo":"angular/angular-cli","slug":"prebundling-has-been-configured-but-will-not-be-us-9f81a9","errorCode":null,"errorMessage":"Prebundling has been configured but will not be used because caching has been disabled.","messagePattern":"Prebundling has been configured but will not be used because caching has been disabled\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/angular_devkit/build_angular/src/builders/dev-server/options.ts","lineNumber":69,"sourceCode":"  const projectRoot = path.join(workspaceRoot, (projectMetadata.root as string | undefined) ?? '');\n\n  const cacheOptions = normalizeCacheOptions(projectMetadata, workspaceRoot);\n\n  // Target specifier defaults to the current project's build target using a development configuration\n  const buildTargetSpecifier = options.buildTarget ?? `::development`;\n  const buildTarget = targetFromTargetString(buildTargetSpecifier, projectName, 'build');\n\n  // Get the application builder options.\n  const browserBuilderName = await context.getBuilderNameForTarget(buildTarget);\n  const rawBuildOptions = await context.getTargetOptions(buildTarget);\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const buildOptions = (await context.validateOptions(rawBuildOptions, browserBuilderName)) as any;\n  const optimization = normalizeOptimization(buildOptions.optimization);\n\n  if (options.prebundle !== false && isEsbuildBased(browserBuilderName)) {\n    if (!cacheOptions.enabled) {\n      // Warn if the initial options provided by the user enable prebundling but caching is disabled\n      logger.warn(\n        'Prebundling has been configured but will not be used because caching has been disabled.',\n      );\n    } else if (optimization.scripts) {\n      // Warn if the initial options provided by the user enable prebundling but script optimization is enabled.\n      logger.warn(\n        'Prebundling has been configured but will not be used because scripts optimization is enabled.',\n      );\n    }\n  }\n\n  let inspect: false | { host?: string; port?: number } = false;\n  const inspectRaw = options.inspect;\n  if (inspectRaw === true || inspectRaw === '' || inspectRaw === 'true') {\n    inspect = {\n      host: undefined,\n      port: undefined,\n    };\n  } else if (typeof inspectRaw === 'string' && inspectRaw !== 'false') {","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular_devkit/build_angular/src/builders/dev-server/options.ts#L51-L87","documentation":"The dev-server's esbuild prebundling (Vite dependency preoptimization) requires persistent build caching. When `prebundle` is enabled (the default) but caching is disabled in the project's cache options, prebundling silently degrades and this warning explains why. Raised in `normalizeOptions` when the resolved builder is esbuild-based.","triggerScenarios":"Running `ng serve` with an esbuild-based builder while `cache` is disabled (e.g. `\"cache\": false` in angular.json or `NG_BUILD_CACHE=off`) and `prebundle` not explicitly set to false.","commonSituations":"Projects that disabled caching due to disk-space or CI concerns, or older angular.json configs created before prebundling existed, now served with the Vite-based dev server.","solutions":["Enable caching in angular.json: set `\"cli\": { \"cache\": { \"enabled\": true } }` under the project","Explicitly set `\"prebundle\": false` in the serve options if you intentionally want no prebundling","Set `NG_BUILD_CACHE=enabled` environment variable if cache config is controlled via env","Ignore the warning if cold-start performance loss is acceptable"],"exampleFix":"// before (angular.json)\n\"cli\": { \"cache\": { \"enabled\": false } }\n// after\n\"cli\": { \"cache\": { \"enabled\": true } }","handlingStrategy":"validation","validationCode":"// validate angular.json before serving\nconst cacheEnabled = workspace.projects[p].architect?.build?.options?.cache?.enabled\n  ?? workspace.cli?.cache?.enabled;\nconst prebundle = serveOptions.prebundle !== false;\nif (prebundle && !cacheEnabled) {\n  console.warn('Prebundling will be skipped: enable cache or set prebundle:false.');\n}","typeGuard":"function prebundlingEffective(opts: { prebundle?: boolean }, cache: { enabled: boolean }): boolean {\n  return opts.prebundle !== false && cache.enabled;\n}","tryCatchPattern":null,"preventionTips":["Keep CLI caching enabled in development workspaces","Set prebundle:false explicitly when disabling cache so intent is documented","Check NG_BUILD_CACHE env overrides in CI containers","Revisit cache settings when upgrading Angular versions"],"tags":["prebundling","caching","vite","dev-server","performance"],"backgroundTag":"prebundling-requires-cache","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}