Fix dependency issues when building precompiled web assets

Review 801 by @tryneus
Closes #1229