Developing Discourse Plugins - Part 1 - Create a basic plugin

In Discourse, mainly there are two big JavaScript sections “discourse” and “admin”. Also you can see few more in discourse/app/assets/javascripts at main · discourse/discourse · GitHub.

In plugins, to differentiate admin & normal user section JavaScript files we use “discourse” and “admin” keywords in between like below

plugins/basic-plugin/assets/javascripts/discourse/initializers/alert.js.es6
plugins/basic-plugin/assets/javascripts/admin/initializers/alert.js.es6


Also it will just work even without identification keywords like you mentioned :slight_smile:

11 Likes