Skip to content

Commit e2d1516

Browse files
author
Yu Tian
committed
Update glob to exclude *.fb.js, replace the check in if statement
1 parent 9a0189b commit e2d1516

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/rollup/packaging.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,14 @@ function copyNodePackageTemplate(packageName) {
172172
? require(packageJson).files
173173
: null;
174174
const npmRootFiles = fs.readdirSync(npmFrom);
175-
const packageRootEntries = glob.sync('*.js', {
175+
// Get all entry points in the package root
176+
// Exceptions: *.fb.js
177+
const packageRootEntries = glob.sync('!(*.fb).js', {
176178
cwd: from,
177179
});
178180
packageRootEntries.forEach(entry => {
179181
// Terminate the build if any entry point in the package root does not have an equivalent in ./npm.
180-
// Exceptions: *.fb.js
181-
if (!npmRootFiles.includes(entry) && !/.fb.js$/.test(entry)) {
182+
if (!npmRootFiles.includes(entry)) {
182183
console.error(
183184
`Entry point ${entry} in package ${packageName} does not have an equivalent in ./npm`
184185
);

0 commit comments

Comments
 (0)