Is there a way to import TS vars file in serverless.yml?



It’s a huge config object and I wanna reuse it within my typescript app. But serverless only supports js files, and I don’t wanna lose the config type information.



I did it by requiring typescript from a Javascript file like this:

module.exports = () => {
  require('ts-node').register({module: "commonjs"});
  return require('./my-typescript.ts');