Get the latest tech news
Comptime.ts: compile-time expressions for TypeScript
A simple-to-use compiler and Vite plugin to evaluate TypeScript expressions at build time.
Apart from function calls and tagged template literals, all sorts of expressions are supported (even complex ones like index access and simple ones like imported constants). Avoid using comptime for: Complex runtime logic Side effects Non-deterministic operations (unless you understand the implications) Note: To force comptime.ts to print the constructed evaluation block for each expression and other debug logs, set the environment variable DEBUG=comptime:*.
Or read this on Hacker News