automatically set precompile assets

backport of #3489