-
Notifications
You must be signed in to change notification settings - Fork 292
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
ncc incorrectly includes __dirname
in .mjs
output
#754
Comments
Node.js 10.x reached End-Of-Life on 2021-04-30 and is no longer receiving updates. If you wish to support older Node.js versions, you can continue using an older ncc version. |
NodeJS 10 support isn't really the issue. I can't run My goal is to get a CJS output (with |
Why not? |
Well, apparently something in the bundled file is using If I use v0.28.6 of @vercel/ncc, I don't have any issues with the output file. |
|
If I run |
The main thing is, I don't want to have to convert everything I have to ESM, so I would like to be able to have ncc output with CJS. I have a lot of stuff, and I'd rather avoid a huge conversion project. |
Can you share more information so we can reproduce the bug? Sounds like a duplicate of #749 |
__dirname
in .mjs
output
My main goal is to keep compatibility with CJS even when I use ESM in a few files. The core issue isn't the error, it's that I don't want an ESM output regardless of whether it works or not. |
As for the source of the
|
Well, I found I can get the old behavior in 0.29.x by using the API instead of the CLI. I'll just go that route, I guess. |
Version 0.29.x (#720) has made it so that if you have a
.mjs
file as an input, you get a.mjs
file as an output. I would like a flag to get back the 0.28.x behavior of outputting it as a.js
file that I can run directly with node, even v10. I can currently accomplish this by using version 0.28.x to build my scripts, but I would rather not be stuck on an old version forever.Please add a flag to force the output of the build into a traditional-style
.js
regardless of what the input is, just like the behavior of v0.28.x.The text was updated successfully, but these errors were encountered: