In a post to his site Sebastian De Deyne shows how to use Laravel Mix to work with Typescript right alongside other packages and libraries included in your mix configuration.
In a recent Spatie project we decided to give TypeScript a shot for the business critical part of a new application. TypeScript provides static analysis to reduce the chance of introducing bugs, to have self-documenting code, and to improve our tooling (autocompletion!)
The remainder of the article is broken down into the four steps (and a bonus) for getting Mix and TypeScript playing together nicely:
- Install The Necessary Dependencies
- Configure TypeScript
- Configure Laravel Mix
- Write Some TypeScript!
The bonus at the end shows how to use this working setup to go one step further and use TypeScript in the Vue.js components in your Laravel application.