Skip to content

Commit

Permalink
Fix build script
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Apr 25, 2023
1 parent 926d3b0 commit 5d97b95
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ function getBuildPath(file, buildFolder) {
return path.resolve(pkgBuildPath, relativeToSrcPath).replace(/\.ts$/, '.js');
}

function buildNodePackage({packageDir, pkg}) {
async function buildNodePackage({packageDir, pkg}) {
const srcDir = path.resolve(packageDir, SRC_DIR);
const files = glob.sync('**/*', {absolute: true, cwd: srcDir, nodir: true});

process.stdout.write(adjustToTerminalWidth(`${pkg.name}\n`));

files.forEach(file => buildFile(file, true));
for (const file of files) {
await buildFile(file);
}

assert.ok(
fs.existsSync(path.resolve(packageDir, pkg.main)),
Expand Down Expand Up @@ -156,5 +158,7 @@ if (files.length) {
} else {
const packages = getPackages();
process.stdout.write(chalk.inverse(' Building packages \n'));
packages.forEach(buildNodePackage);
for (const pkg of packages) {
await buildNodePackage(pkg);
}
}

0 comments on commit 5d97b95

Please sign in to comment.