Closed shellscape closed 6 months ago
OK I totally missed this in the docs: https://github.com/isaacs/tshy?tab=readme-ov-file#excluding-from-a-build-using-cts-and-mts-files
If that's the correct method, please close this one.
Yup! Just name it .mjs and it'll only be esm.
I've got a project where I have to build artifacts in the same
src
directory: the primary module, and the CLI for the module. The ideal setup is that the primary module is compiled to both commonjs and esm, but the CLI is built only with esm (as the"bin"
property in package.json references only the esm build). Right now, tshy is attempting to include the CLI in the commonjs output and it's throwing all kinds of errors like:I don't want tshy to consider commonjs for the CLI at all. How can this be accomplished with tshy?