How to add JS files to specific templates?

I agree, this should be easier / have a default API to deal with this, but someone needs to put the work to add it. :smiley:

Nowadays it seems everyone just uses a big file with scripts and styles and be done with it. :slight_smile:

Anyway, what we did was in the root layout, add a call to a helper function that grabs the path of the styles / scripts to add if the key script / style is in the assigns.

image

The Helper being something like: