There are many issues with adding JavaScipt to Pug templates including:
- PugJS throws exceptions on many JavaScript functions that are perfectly valid.
- When your JavaScript functions have syntax errors they are not identified for you.
- You can't set a breakpoint in a JavaScript function within a Pug template
- You can't use Typescript to help with robustness
What is the preferred/recommended way to use JavaSript functions with Pug?