Src/environments are environment.ts environment.prod.ts. In dev mode using the first, the prod - the second. And by default there is at least one field - production: true/false.
Accordingly, in your module file, write something like this:
let declarations = [SomeComponent]; if (!environment.production) { const devDeclarations = [/*your dev components*/]; declarations = declarations.concat(devDeclarations); // equivalent to [...declarations, ...devDeclarations] } @NgModule({ declarations, /*...*/ }) export class SomeModuleClass {}