gulp-inline-template
Advanced tools
+2
-2
@@ -46,6 +46,6 @@ var through = require('through2'); | ||
| case '__inline': | ||
| return JSON.stringify(fs.readFileSync(filePath).toString()) | ||
| return JSON.stringify(fs.readFileSync(filePath).toString().replace(/\r\n/g,'\n')) | ||
| break; | ||
| case '__template': | ||
| return ejs.compile(fs.readFileSync(filePath).toString(),ejsConfig).toString().replace('function anonymous(locals, escape, include, rethrow','function(data,escape'); | ||
| return ejs.compile(fs.readFileSync(filePath).toString().replace(/\r\n/g,'\n'),ejsConfig).toString().replace('function anonymous(locals, escape, include, rethrow','function(data,escape'); | ||
| break; | ||
@@ -52,0 +52,0 @@ } |
+3
-2
| { | ||
| "name": "gulp-inline-template", | ||
| "version": "1.1.3", | ||
| "version": "1.1.4", | ||
| "description": "Inline template into js file as string or function.", | ||
@@ -15,3 +15,4 @@ "main": "index.js", | ||
| "gulp", | ||
| "inline" | ||
| "inline", | ||
| "template" | ||
| ], | ||
@@ -18,0 +19,0 @@ "author": "loviselu", |
+3
-3
@@ -13,4 +13,4 @@ # gulp-inline-template | ||
| <ul class="ul"> | ||
| <% for(var i=0;i<list.length;i++) { %> | ||
| <li><%=list[i]%></li> | ||
| <% for(var i=0;i<data.list.length;i++) { %> | ||
| <li><%=data.list[i]%></li> | ||
| <% } %> | ||
@@ -25,3 +25,3 @@ </ul> | ||
| //after compile: | ||
| var a = "<ul class=\"ul\">\n\t<% for(var i=0;i<list.length;i++) { %>\n\t<li><%=list[i]%></li>\n\t<% } %>\n</ul>\n"; | ||
| var a = "<ul class=\"ul\">\n\t<% for(var i=0;i<data.list.length;i++) { %>\n\t<li><%=data.list[i]%></li>\n\t<% } %>\n</ul>\n"; | ||
| var b = function(data,escape | ||
@@ -28,0 +28,0 @@ /**/) { |
4635
5.22%