For each template type, lib/stylesheet/index.js calls getTemplatedStylesheet once passing in the contents of a file for the respective built in template, and getTemplatedStylesheet then returns a function that is used as renderStylesheet in nsg.js.
However, when using a custom template file,getTemplatedStylesheet is passed the filename instead of the contents of the file.