-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat(devkit): allow requiring cts config files #31103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
View your CI Pipeline Execution ↗ for commit e664514.
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if we know that the file is specifically .cts
or .mts
, we can choose either require
or dynamic import
without having to do what load
function currently does (which is try one, then try the other).
@jaysoo thank you for the feedback. I'll update the code accordingly. |
…spiled by ts-node/swc into CJS
I tested this locally. I had to make the This PR now fixes the |
When migrating our project to esm, we encountered an issue with the playright plugin, but more generally with the
loadConfigFile
from the devkit.Our configuration is a
.cts
file, but it's not treated as commonjs:__dirname
and__filename
are not available.Expected Behavior
.cts
files are interpreted as commonJS files when in a module context.