diff --git a/commands/build.ts b/commands/build.ts index e133df99..1ad1b5a0 100644 --- a/commands/build.ts +++ b/commands/build.ts @@ -62,6 +62,12 @@ export default class Build extends BaseCommand { }) declare packageManager?: 'npm' | 'pnpm' | 'yarn' | 'yarn@berry' | 'bun' + /** + * Define custom tsconfig path to be used during the build process + */ + @flags.string({ description: 'Define the tsconfig path' }) + declare tsconfig?: string + /** * Log a development dependency is missing * @@ -112,7 +118,9 @@ export default class Build extends BaseCommand { * Bundle project for production */ const stopOnError = this.ignoreTsErrors === true ? false : true - const builtSuccessfully = await bundler.bundle(stopOnError, this.packageManager) + const builtSuccessfully = await bundler.bundle(stopOnError, this.packageManager, { + tsconfigPath: this.tsconfig, + }) if (!builtSuccessfully) { this.exitCode = 1 }