Accept .mts files in the editor

Hi, to reflect the use of .mjs files as ESM libraries, would you consider accepting the .mts extension for scripts in the editor? This would probably not change anything from the usage of .ts files but just adding it as a usable format just seems logical to me.

2 Likes

It’s not in the plan currently, can you describe the need or the value of it ?

Hi pandamicro,

We are scaffolding reusable libs with a monorepo which ends up in npm packages. Knowing the import of CJS modules doesn’t work well into cocos creator ( see my other post about destructuring in imports, sorry it appears I’m not allowed to post links ) we tried creating our libs using mts files so they generate mjs files.

These appear to work fine withing cocos creator but we’d still have to create .ts files for the actual scripts used within the editor and it brings its share of issues regarding tooling inside the monorepo.

Anyway, we will try to find another solution in the meantime.

I’ll pass the topic to scripting team

1 Like

Its awesome! Thank you very much!

Sorry,mts is not in our supporting plan, otherwise we should also support cts files, but CommonJS is not supported in the scripts created in editor.

it brings its share of issues regarding tooling inside the monorepo.

can you explain what the exact issue is ?maybe we can help solve it.
It is best to have a specific demo