Skip to content

Commit

Permalink
fix(core): disable ts-node warning when its using a fast transpiler (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
forivall committed Nov 7, 2022
1 parent 8550035 commit 5ade725
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/nx/src/utils/register.ts
Expand Up @@ -36,18 +36,21 @@ export const registerTsProject = (
// We can fall back on ts-node if its available
const tsNodeInstalled = packageIsInstalled('ts-node/register');
if (tsNodeInstalled) {
warnTsNodeUsage();
const { register } = require('ts-node') as typeof import('ts-node');

// ts-node doesn't provide a cleanup method
registerTranspiler = () => {
register({
const service = register({
project: tsConfigPath,
transpileOnly: true,
compilerOptions: {
module: 'commonjs',
},
});
// Don't warn if a faster transpiler is enabled
if (!service.options.transpiler && !service.options.swc) {
warnTsNodeUsage();
}
return () => {};
};
}
Expand Down

1 comment on commit 5ade725

@vercel
Copy link

@vercel vercel bot commented on 5ade725 Nov 7, 2022

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-five.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx.dev
nx-dev-nrwl.vercel.app

Please sign in to comment.