diff --git a/packages/knip/fixtures/plugins/angular2/src/main.server.ts b/packages/knip/fixtures/plugins/angular2/src/main.server.ts new file mode 100644 index 000000000..e69de29bb diff --git a/packages/knip/src/plugins/angular/index.ts b/packages/knip/src/plugins/angular/index.ts index 2693dd8ca..d02c4397c 100644 --- a/packages/knip/src/plugins/angular/index.ts +++ b/packages/knip/src/plugins/angular/index.ts @@ -44,6 +44,9 @@ const resolveConfig: ResolveConfig = async (co if ('tsConfig' in opts && typeof opts.tsConfig === 'string') { inputs.add(toConfig('typescript', opts.tsConfig, configFilePath)); } + if ('server' in opts && opts.server && typeof opts.server === 'string') { + inputs.add(toProductionEntry(join(cwd, opts.server))); + } } } } diff --git a/packages/knip/test/plugins/angular2.test.ts b/packages/knip/test/plugins/angular2.test.ts index abddda0a1..a444d83eb 100644 --- a/packages/knip/test/plugins/angular2.test.ts +++ b/packages/knip/test/plugins/angular2.test.ts @@ -15,7 +15,7 @@ test('Find dependencies with the Angular plugin (2)', async () => { assert.deepEqual(counters, { ...baseCounters, - processed: 2, - total: 2, + processed: 3, + total: 3, }); });