Skip to content

Commit

Permalink
fix(core): use located tsconfig name for tsconfig-paths when register…
Browse files Browse the repository at this point in the history
…ing local plugin transpiler (#16476)
  • Loading branch information
AgentEnder authored Apr 21, 2023
1 parent ddf613c commit 0e68441
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/nx/src/utils/nx-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,16 +260,18 @@ export function registerPluginTSTranspiler() {
if (!tsNodeAndPathsRegistered) {
// nx-ignore-next-line
const ts: typeof import('typescript') = require('typescript');
const tsConfigName = existsSync('tsconfig.base.json')
? 'tsconfig.base.json'
: existsSync('tsconfig.json')
? 'tsconfig.json'
: null;

// Get the first tsconfig that matches the allowed set
const tsConfigName = [
join(workspaceRoot, 'tsconfig.base.json'),
join(workspaceRoot, 'tsconfig.json'),
].find((x) => existsSync(x));

const tsConfig: Partial<ts.ParsedCommandLine> = tsConfigName
? readTsConfig(tsConfigName)
: {};

registerTsConfigPaths(join(workspaceRoot, 'tsconfig.base.json'));
registerTsConfigPaths(tsConfigName);
registerTranspiler({
experimentalDecorators: true,
emitDecoratorMetadata: true,
Expand Down

1 comment on commit 0e68441

@vercel
Copy link

@vercel vercel bot commented on 0e68441 Apr 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-git-master-nrwl.vercel.app
nx-five.vercel.app
nx-dev-nrwl.vercel.app
nx.dev

Please sign in to comment.