TypeScript Support
Latte can be used with TypeScript and for TypeScript projects.
TypeScript Support
To use Latte with TypeScript you need to install tsx (https://tsx.is):
npm install -D tsxpnpm -D install tsxyarn add -D tsxbun add -D tsxChange test command
{ "scripts": { "test": "NODE_OPTIONS=\"--import tsx\" latte --ts" }}
Windows
If you’re using Windows, we recommended to use cross-env package to set environment variables:
npm install -D cross-envpnpm -D install cross-envyarn add -D cross-envbun add -D cross-envAnd then change your test command to:
{ "scripts": { "test": "cross-env NODE_OPTIONS=\"--import tsx\" latte" }}