diff --git a/package.json b/package.json index 67b947d..3566609 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "package config plugin" ], "license": "MIT", - "version": "2.0.0-next.1", + "version": "2.0.0-next.2", "bugs": "https://github.com/simonkovtyk/esbuild-plugin-package-json/issues", "homepage": "https://github.com/simonkovtyk/esbuild-plugin-package-json", "repository": { diff --git a/src/core/helpers/out.helper.ts b/src/core/helpers/out.helper.ts index 694e34e..1e16744 100644 --- a/src/core/helpers/out.helper.ts +++ b/src/core/helpers/out.helper.ts @@ -9,10 +9,17 @@ const resolveOutDir = (options: EsbuildOptionPaths & PathOverrides): string => { const outBase: string = options.outBase ?? "."; + if (options.outDir !== undefined) + return path.join( + process.cwd(), + outBase, + options.outDir + ); + return path.join( process.cwd(), outBase, - options.outDir ?? options.outFile === undefined + options.outFile === undefined ? "dist" : path.parse(options.outFile).dir );