Add <library /> preload support to v2 template