Precedence order of javascripts between plugins and themes

@members

Javascript files are treated exactly the same as they are in core/plugins, so you should follow the same file/folder structure. Theme files are loaded after core/plugins, so if the filenames match, the theme version will take precedence.

1 Like

If don’t care about any of that, just override the template programatically as explained here How to override component templates programatically?

1 Like

It’s still useful though because it means you can potentially reskin an existing plugin for a new client without changing the plugin.

1 Like

I don’t think this is always the case. For example the Pricemate Theme will not work if you install TLP or the Events plugin presently, all of which override the Topic List Item raw file.

1 Like

Whoops haha. Seems that it was a bug!

1 Like

Good catch.

This might work with CSS but from my tests this does not work with hbr templates.

1 Like

Solution here: Splitting up theme Javascript into multiple files - developers - Discourse Meta