Skip to content

Commit 4fe4fe9

Browse files
fix(vite): allow force ignore of logs from nxViteTsPaths plugin #29320 (#30200)
## Current Behavior When Vite build is run where: - `nxViteTsPaths` plugin is enabled - `--verbose` or `NX_VERBOSE_LOGGING=true` is set The resulting logs can be quite noisy. ## Expected Behavior When `debug` is explicitly set to false, ignore logs even when `--verbose` is passed. Usage: ```ts nxViteTsPaths({ debug: false }) ``` ## Related Issue(s) Fixes #29320 --------- Co-authored-by: Leosvel Pérez Espinosa <[email protected]>
1 parent 7a73e8a commit 4fe4fe9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/vite/plugins/nx-tsconfig-paths.plugin.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ import { isUsingTsSolutionSetup } from '@nx/js/src/utils/typescript/ts-solution-
2424
export interface nxViteTsPathsOptions {
2525
/**
2626
* Enable debug logging
27-
* @default false
27+
* If set to false, it will always ignore the debug logging even when `--verbose` or `NX_VERBOSE_LOGGING` is set to true.
28+
* @default undefined
2829
**/
2930
debug?: boolean;
3031
/**
@@ -223,7 +224,7 @@ export function nxViteTsPaths(options: nxViteTsPathsOptions = {}) {
223224
}
224225

225226
function logIt(...msg: any[]) {
226-
if (process.env.NX_VERBOSE_LOGGING === 'true' || options?.debug) {
227+
if (process.env.NX_VERBOSE_LOGGING === 'true' && options?.debug !== false) {
227228
console.debug('\n[Nx Vite TsPaths]', ...msg);
228229
}
229230
}

0 commit comments

Comments
 (0)