Skip to content

Commit ea55f09

Browse files
committed
fix(core): parseEntryPointsFromCli handles now correctly whitespace between comma separated entryPoints given from CLI
1 parent 43cd901 commit ea55f09

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

packages/core/src/lib/cli/internal/parse-entry-points-from-cli.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ export function parseEntryPointsFromCli(
1414
const entryPoints: Record<string, string> = {};
1515

1616
for (const entry of splittedEntries) {
17-
const entryPoint = entryPointsFromConfig[entry];
17+
const trimmedEntry = entry.trim();
18+
const entryPoint = entryPointsFromConfig[trimmedEntry];
1819
if (entryPoint) {
19-
entryPoints[entry] = entryPoint;
20+
entryPoints[trimmedEntry] = entryPoint;
2021
}
2122
}
2223
return entryPoints;

packages/core/src/lib/cli/tests/parse-entry-points-from-cli.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,19 @@ describe(parseEntryPointsFromCli.name, () => {
4141
const result = parseEntryPointsFromCli('src/main.ts', config);
4242
expect(result).toBeUndefined();
4343
});
44+
45+
it('should ignore whitespace between comma separated entryPoints', () => {
46+
const config: Configuration = {
47+
entryPoints: {
48+
'app-i': 'src/app-i.ts',
49+
'app-ii': 'src/app-ii.ts',
50+
},
51+
} as unknown as Configuration;
52+
const result = parseEntryPointsFromCli('app-i, app-ii', config);
53+
54+
expect(result).toEqual({
55+
'app-i': 'src/app-i.ts',
56+
'app-ii': 'src/app-ii.ts',
57+
});
58+
});
4459
});

0 commit comments

Comments
 (0)