Fix bug Issue #528

Hi, this pull request is to fix bug that when precompile entire template folder with amd pattern