The proper solution is to list ALL the dependent modules in the list. When compiling programs for the web, we should be careful about not including unnecessary libraries.
Enabling entire groups in your ITK build is not overly helpful in identifying the exact dependent module. WhatModulesITK.py script should be helpful with that. Also take a look at this thread.