Usage of spread array in Strapi Plugin Admin side

System Information
  • Strapi Version: 4.9.0
  • Operating System: Ubuntu 22.04
  • Database: MySQL
  • Node Version: 18.15.0

Hi. I’m making a plugin for my own needs with Typescript. And admin part of the plugin uses spread array functions […generateClasses(generators, config)], generator spread to array and string.replaceAll()

And no matter how hard I try I get errors from webpack can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.

I know that I need to specify the flag that ts would generate code to support such functions in older browsers or raise the target. But in my config target is already set to the newest. Also adding flags does not change anything. In this case, the functionality works fully on the admin side, but errors are still displayed when building the admin part.

Has anyone encountered this?

Found a not entirely convenient solution.

I put the utilities I wrote into a separate typescript project, in this project I build them with type declaration generation. And assembled utilities are transferred to admin part. After that everything works as it should because it is already compiled JS with declarations.

But the problem still remains because it feels that when building the plugin strapi does not use tsconfig from plugin folder where target: ESNext is specified, but uses only its config from @strapi/typescript-utils/tsconfigs/admin, where target: ES5 is set