Can I organize my custom module's twig templates into subfolders? My module now has a lot of TWIG template files in the /custom/MYMODULE/template folder. I tried creating some sub-folders because I thought Drupal 8was supposed to search all sub-folders automatically but I got an error about a missing template file. Should it work? 

I've tried setting the subfolder name in '#theme' =&gt; 'SUBFOLDER/mytemplate' and I don't get an error, but the block contents are just blank (although the title displays).

I have my template defined in MYMODULE_theme(), but it feels wrong to specify a sub-folder in there.
This is what the docs for hook_theme say about the template property:


  If specified, the theme implementation is a template file, and this is the template name. Do not add 'html.twig' on the end of the template name. The extension will be added automatically by the default rendering engine (which is Twig.) If 'path' is specified, 'template' should also be specified. If neither 'template' nor 'function' are specified, a default template name will be assumed. For example, if a module registers the 'search_result' theme hook, 'search-result' will be assigned as its template name.


Unless you've found a bug of omission, I would expect these docs to tell you if there was any auto-scanning of sub-folders going on. The fact that you've tried it and it doesn't work might be seen to back that up.

If you've seen other official docs that reference an auto-scanning feature, you may have hit a bug.

As an aside, I'm not sure what the intent of this code is:

'#theme' =&gt; 'SUBFOLDER/mytemplate'


You would never write that; you would instead use hook_theme to register your template with the system, and put the path to the file itself in the template property. Then you'd use:

'#theme' =&gt; 'theme_key'


in the render array