Skip to content

Commit df97e05

Browse files
committed
fix: using getInputsFromScripts on config.app
1 parent 30dff7b commit df97e05

File tree

1 file changed

+3
-3
lines changed
  • packages/knip/src/plugins/aws-cdk

1 file changed

+3
-3
lines changed

packages/knip/src/plugins/aws-cdk/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ const isEnabled: IsPluginEnabled = ({ dependencies }) => hasDependency(dependenc
1414

1515
const config: string[] = ["cdk.json"];
1616

17-
const resolveConfig: ResolveConfig<AwsCdkConfig> = async config => {
17+
const resolveConfig: ResolveConfig<AwsCdkConfig> = async (config, options) => {
1818
if (!config) return [];
1919

20-
const app = config.app.split(" ")[0];
20+
const app = options.getInputsFromScripts(config.app, { knownBinsOnly: true });
2121
const watch = config.watch?.include ?? [];
2222
const context = Object.keys(config.context ?? {}).map(key => key.split("/")[0]) ?? [];
23-
return compact([app, ...watch, ...context]).map(id => toDependency(id));
23+
return compact([...app, ...watch, ...context]).map(id => (typeof id === 'string' ? toDependency(id) : id));
2424
};
2525

2626
const production: string[] = [

0 commit comments

Comments
 (0)