-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add check for dependencies that need externalizing during bundle
- Loading branch information
1 parent
a5a9fc7
commit 3fea6d7
Showing
2 changed files
with
19 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const { exec } = require('child_process'); | ||
|
||
const commandToRun = 'yarn build && node ./scripts/build.js'; | ||
|
||
// Run the command | ||
exec(commandToRun, (error, stdout, stderr) => { | ||
// Combine stdout and stderr to check the entire output | ||
const output = `${stdout}\n${stderr}`; | ||
console.log('aaaa', output); | ||
// Check if the output contains the error string of esbuild | ||
if (output.includes('[require-resolve-not-external]')) { | ||
console.error('Error: A dependency that has to be externalized in esbuild process is found. Please resolve it!'); | ||
process.exit(1); // Exit with an error code | ||
} else { | ||
process.exit(0); // Exit with success code | ||
} | ||
}); |