0

I have been developing plugins for RPG Maker MV, with the lowest version they support being 1.5.1. That means I need the output to be ES5-compatible, and despite having tsconfig set up like so:

{
    "compilerOptions": {
      "target": "es5",
      "module": "ES2015",
      "esModuleInterop": true,

      "sourceMap": false,
      "downlevelIteration": true,
    },
}

The compilation uses arrow functions thanks to a certain dependency a couple of my plugins use. I manage to make the output work by rewriting the arrow functions in it, but I'd rather not have to do that every time I compile.

What should I do to make it so the output's ES5-compatible while still letting me use ES6 features in the TS source? Oh, and here's the minimal reproducible example:

var someParams = { "TargetInStates": "[\"12\"]" };
console.log(convertParameters(someParams));
Tespy
  • 971
  • 2
  • 9
  • 18
  • 1
    Could you demonstrate with a [mre] suitable for pasting into a standalone IDE, or barring that, a link to a web IDE project that shows this happening? As far as I know TypeScript's output will be ES5 compatible if you set the target as ES5 ([right?](https://tsplay.dev/WvALnm)), so presumably the problem is in the "certain dependency" and we need more information there. – jcalz Sep 26 '22 at 00:36
  • @jcalz Sorry for taking so long to respond... The minimal reproducible example is here: https://pastebin.com/82vv8Hqg It assumes that you have fenix-tools installed. The issue does seem to be fenix-tools, but I have no idea how or why it would bypass the target in the tsconfig being set to es5 – Tespy Oct 06 '22 at 11:44
  • Hmm, well, I guess there's no `fenix-tools` tag so I don't know how to get eyes on this where someone could help you. Still, you should probably [edit] the question to prominently talk about fenix-tools (probably in the title) and include your [mre] as plain text in the question itself. Good luck! – jcalz Oct 06 '22 at 16:13

0 Answers0