You have multiple options:
- Use Twig with Webpack to bundle (compile, combine and minimize) web assets. Slim 4 - Compiling Assets with Webpack
- Use a Twig assets extension like odan/twig-assets (inspired by Symfony Web Assets)
- Use Twig (without extensions). Just create static CSS and JS files in your
public/
directory and include them in your templates.