Right, the doc wasn't clear. If it's in a sub-directory, Joplin expects a certain structure, as built by the yo plugin command, but if it's a single JS file it can be name anything. So the rule is actually:

The plugin service will look at the following locations:

  • plugins/(PLUGIN_ID).js
  • plugins/(PLUGIN_ID)/index.js
  • plugins/(PLUGIN_ID)/dist/index.js
  • Any directory or file that starts with "_" will be excluded (convenient to quickly disable a plugin)

PLUGIN_ID can be any string but it must be unique.