How can I suppress the warning Add only entry points to the 'files' or 'include' properties in...

Discussão em 'Angular' iniciado por user30124434, Março 31, 2025.

  1. user30124434

    user30124434 Guest

    When building my NX Angular application I include "/env.ts" in tsconfig.app.json. I do this to compile all env files. However I determine which ones will be used in webpack.config.ts. I add files like env.qa.ts as entry points depending on some logic. So basically I don't know what env.x.ts will or will not be part of the build until webpack does its work. This leads to the warning, "is part of the TypeScript compilation but it's unused. Add only entry points to the 'files' or 'include' properties in your tsconfig."

    I can't simply exclude the env files as I don't know which ones I will need until webpack completes. My project actually has hundreds of env.ts files, so this warning comes up a lot. Please let me know if there is some way to suppress this warning.

    I tried setting warnings to false in webpack config.stats.warnings. That didn't work. I can't seem to find a suppression flag or a work around.

    Continue reading...

Compartilhe esta Página