Closed N0tExisting closed 2 years ago
Any updates on this PR?
I merged and tagged this, and then tried to use the CLI locally and got this error:
file:///Users/aaron/Code/torchlight/torchlight-cli-test/node_modules/@torchlight-api/torchlight-cli/lib/bin/torchlight.js:4
var _cli = require("../cli.js");
^
ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and '/Users/aaron/Code/torchlight/torchlight-cli-test/node_modules/@torchlight-api/torchlight-cli/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
which is what I was afraid of. Going to revert now and see if I can figure out to make it work.
Ok I think I got this fixed, now publishing both CJS and ESM.
This PR correctly makes the package an ESModule