Open nickdnk opened 6 months ago
To clarify, the JS output from tsc
simply becomes this, which seems to work fine.
// rcon.js
exports.default = RCON;
module.exports = RCON;
I'm using the package like this. All other dependencies in the project work fine using the import
statement, just like the readme for this package tells me to do.
// package.json
{
"type": "module",
"dependencies": {
"typescript": "^5.1.6",
"rcon-srcds": "^2.1.0"
}
}
// app.ts
import RCON from "rcon-srcds";
new RCON({...});
// error
For TypeScript I'm using "target": "ES2022"
and "module": "ES2022"
At first glance, this does not look like it's gonna be an issue. I want to make sure this works properly though, so I'll verify it before merging.
I have published Nico's branch to @robertsspaceindustries/rcon-srcds until it is merged and published.
Hello
This fixes https://github.com/EnriqCG/rcon-srcds/issues/13 which just broke my system (again).
I'm not very well-versed in node or modules, but I know this makes the package work as a module and prevents the above error, probably without breaking anything else, as I left the normal export default in there.