diff --git a/src/project.coffee b/src/project.coffee index 2957887..9089169 100644 --- a/src/project.coffee +++ b/src/project.coffee @@ -334,8 +334,8 @@ class Project Path.basename(file, ".eco").capitalize() ].join("") - output = output.replace(/^module.exports/, "this.$templates.#{templateName}") - output = "if(!this.$templates){\n $templates={};\n};\n\n" + output + output = output.toString().replace(/^module.exports/, "this.$templates.#{templateName}"); + output = "if(!this.$templates){\n $templates={};\n};\n\n this.$templates.#{templateName} = " + output sys.puts " * Compiled " + outpath fs.writeFileSync Path.join(@root, outpath), output