From 69b28037f68ebd615470bbb027252cc82822aed0 Mon Sep 17 00:00:00 2001 From: aadamcik Date: Sat, 21 Mar 2026 20:23:49 +0100 Subject: [PATCH] feat: add tsconfig flag to build command --- commands/build.ts | 10 +++++++++- package.json | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) 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 } diff --git a/package.json b/package.json index 5ad2be3c..4da1656b 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "index:commands": "node --import=@poppinss/ts-exec toolkit/main.js index build/commands" }, "devDependencies": { - "@adonisjs/assembler": "^8.0.1", + "@adonisjs/assembler": "^8.2.0", "@adonisjs/eslint-config": "^3.0.0", "@adonisjs/prettier-config": "^1.4.5", "@adonisjs/tsconfig": "^2.0.0",