Skip to content

Commit 18cde1d

Browse files
authored
chore: optimize getting extraEntryPoints in buildUtils (#15074)
1 parent 559449e commit 18cde1d

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

scripts/buildUtils.mjs

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -238,24 +238,22 @@ export function createBuildConfigs() {
238238
// skip expect for now
239239
pkg.name === 'expect'
240240
? {}
241-
: Object.keys(pkg.exports)
242-
.filter(
243-
key =>
244-
key !== '.' &&
245-
key !== './package.json' &&
246-
!key.startsWith('./bin'),
247-
)
248-
.reduce((previousValue, currentValue) => {
249-
return {
250-
...previousValue,
251-
// skip `./`
252-
[currentValue.slice(2)]: path.resolve(
253-
packageDir,
254-
'./src',
255-
`${currentValue}.ts`,
256-
),
257-
};
258-
}, {});
241+
: Object.keys(pkg.exports).reduce((previousValue, currentValue) => {
242+
if (
243+
currentValue !== '.' &&
244+
currentValue !== './package.json' &&
245+
!currentValue.startsWith('./bin')
246+
) {
247+
// skip `./`
248+
previousValue[currentValue.slice(2)] = path.resolve(
249+
packageDir,
250+
'./src',
251+
`${currentValue}.ts`,
252+
);
253+
}
254+
255+
return previousValue;
256+
}, {});
259257

260258
return {
261259
packageDir,

0 commit comments

Comments
 (0)