serverless / serverless-plugin-typescript

Serverless plugin for zero-config Typescript support
MIT License
781 stars 222 forks source link

adds .mts to .mjs support, rather than throwing an error #295

Open cwbuecheler opened 1 year ago

cwbuecheler commented 1 year ago

Closes #294 Node.js 18.x requires files to be named .mjs instead of .js to use modern ES imports instead of module.exports. Typescript can be set up to compile it without issue using the .mts extension, but the plugin was failing before getting to the compile. This is just a quick little PR that resolves the issue. All tests / lints / etc pass, and I've tested locally and it works fine with sls deploy.