You can write your Webpack config in Typescript, and it’ll save you a huge amount of pain. Webpack’s docs would lead you to believe that using Typescript requires a hacky customized set up, but in fact it’s as simple as installing a single module and changing your extensions from .js to .ts!
You can find the rest of the post at the Webpack blog.