porsager / wright

🚀 Work Fast Work Wright
Do What The F*ck You Want To Public License
178 stars 15 forks source link

Support watching .mjs (javascript module) files #42

Closed shofetim closed 3 years ago

shofetim commented 4 years ago

It looks like wright only watches .js .ts and .ls files. Most of my client side JS is in .mjs files these days, served without a build process (it is a little cutting edge, but browser support is good, and I don't need to support every browser).

porsager commented 4 years ago

Hi. Sorry for the late reply.

I haven't taken mjs into consideration since mjs has no meaning in the browser, and is purely a node construct. I think the verdict is still out on mjs generally, so I'm not seeing myself looking into it, but if you want to PR support yourself, I'm fine with that 🙂

porsager commented 4 years ago

Apparently I did have a weird condition regarding mjs that seemed to be reversed, and probably the cause for watching not working, so I've gone ahead and fixed that 😛 Let me know if it does anything for you.

shofetim commented 4 years ago

Thank you for the response, late or no.

You type faster than I do. The below might still be of some use though.

I guess the file extension .mjs likely has no meaning to browsers, they use the <script type="module"> instead, but browsers do widely support ES6 modules - no need for transpiling/node/etc.

porsager commented 4 years ago

I guess the file extension .mjs likely has no meaning to browsers, they use the Githubissues.

  • Githubissues is a development platform for aggregating issues.