Support for .mjs files (ESM module loader)

Hi,

Node v8.5 shipped the ESM module loader feature behind a flag: node --experimental-modules index.jsm
It seems that you’re not currently supporting .mjs files at all.
No syntax highlighting and no hot reload are available for this type of files.

Is there any plan to support that feature?

Cheers.

4 Likes

I imagine so, yes. In the meantime, you can configure which file types trigger a restart on edit with use of a watch.json file. See https://glitch.com/faq#restart

Syntax highlighting comes from our use of CodeMirror, so our support for it is downstream of their support.

Alright!

The watch.json config goes already a long way.
Thanks for your help Gareth.

Cheers!

It seems like CodeMirror should have the ability to configure different extensions to different syntax highlighting. Is that possibly something that could be fixed on the Glitch side?

1 Like

Yes, there are many situations where a particular file extension isn’t supported, but an existing syntax highlighting setting would be perfectly acceptable.

In this case why not let authors set the syntax highlighting of a file if CodeMirror can’t automatically determine it?