Command
serve
Is this a regression?
The previous version in which this bug was not present was
v19
Description
Trying to serve an angular application that has the following imports:
import authJsPkgJson from '@badisi/auth-js/package.json' with { type: 'json' };
import authVuePkgJson from '@badisi/auth-vue/package.json' with { type: 'json' };
import ngxAuthPkgJson from '@badisi/ngx-auth/package.json' with { type: 'json' };
will result in the following errors:
Cannot optimize dependency: @badisi/auth-js/package.json, present in client 'optimizeDeps.include'
Cannot optimize dependency: @badisi/auth-vue/package.json, present in client 'optimizeDeps.include'
Cannot optimize dependency: badisi/ngx-auth/package.json, present in client 'optimizeDeps.include'
Issue
Json file imports should not be considered "dependency" and be optimized.
Minimal Reproduction
Add any json file import in an angular application and run ng serve.
Exception or Error
Your Environment
Angular CLI : 21.2.13
Angular : 21.2.15
Node.js : 24.14.1
Package Manager : npm 11.16.0
Operating System : darwin x64
Anything else relevant?
Command
serve
Is this a regression?
The previous version in which this bug was not present was
v19
Description
Trying to serve an angular application that has the following imports:
will result in the following errors:
Issue
Json file imports should not be considered "dependency" and be optimized.
Minimal Reproduction
Add any json file import in an angular application and run
ng serve.Exception or Error
Your Environment
Anything else relevant?
optimizeDeps.includedefined in the app'sangular.jsonfileng serveruns and does no harm, so it seems to be only warnings.