Skip to content

Commit

Permalink
chore: optimize build (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
alikirec authored Sep 19, 2024
1 parent 15fc8ed commit 2494ca9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"scripts": {
"lint": "eslint . --ext .ts,.tsx,.js --cache --cache-strategy content",
"format": "yarn lint --fix",
"build": "yarn workspaces run build",
"build": "node ./scripts/build.js",
"test": "yarn workspaces run test",
"pack": "yarn workspaces run pack"
},
Expand Down
15 changes: 15 additions & 0 deletions scripts/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const { execSync } = require('child_process');

const workspaces = JSON.parse(
execSync('yarn workspaces info --json').toString()
);

const workspaceNames = Object.keys(workspaces);

for (const workspaceName of workspaceNames) {
// don't build example workspaces
if (!workspaceName.includes('example-')) {
// run build for this workspace
execSync(`yarn workspace ${workspaceName} build`, { stdio: 'inherit' });
}
}

0 comments on commit 2494ca9

Please sign in to comment.