8
A
回答
13
這個工作對我來說: https://github.com/balderdashy/sails/issues/2188#issuecomment-56994236
在配置/ views.js:
var minify = require('html-minifier').minify;
var ejs = require('ejs-locals');
var parsing = function(path,options,fn) {
options.locals = options.locals || {};
options.locals._layoutFile = 'layout.ejs';
ejs(path, options, function(err, str){
str = minify(str,{collapseWhitespace: true, removeComments: true});
return fn(err, str);
});
};
module.exports.views = {
engine: {
ext: 'ejs',
fn: parsing
},
layout: false
};
相關問題
- 1. 「最小化所有」與NSBorderlessWindowMask
- 2. JQuery最小化和最大化HTML Div
- 3. 將所有表格最小化的類
- 4. 最小化所有應用程序
- 5. 最小化所有打開的窗口?
- 6. .NET最小化到托盤和最小化所需資源
- 7. httpd Reverseproxy服務於HTML頁面服務的所有文件
- 8. 如何將所有HTTP請求記錄到我的Sails.js服務器?
- 9. HTML字符實體引用最大化和最小化
- 10. 最大化/最小化HTML表<th>使用jQuery
- 11. 如何使用Sails.js實現ReST服務?
- 12. 禁用Sails.js靜態資產服務
- 13. Sails.js服務器請求超時
- 14. Sails.js服務器不再啓動
- 15. 將HTML最小化爲一行
- 16. 壓縮(最小化)來自python的HTML
- 17. 最小化html表格的樣式
- 18. 在div中最小化html預覽
- 19. HTML在線最小化器/壓縮器?
- 20. GWT最小化生成的HTML代碼
- 21. OData服務開發所需的最小.NET框架是什麼
- 22. 最小化/最大化div
- 23. 春季服務層 - autowire所有服務
- 24. 使用Google AJAX Libraries API服務最小化prototype.js文件?
- 25. 使用jQuery Ajax調用SOAP-XML Web服務 - 最小化實現?
- 26. 如何最小化網絡服務器重定向流量?
- 27. 最小化WCF服務客戶端的內存使用情況
- 28. MySQL最小/最大所有行
- 29. 如何從任務欄最小化和最大化winform?
- 30. 我沒有收到來自FORMDATA數據在我sails.js服務器
爲什麼我不能用諧音使用它?我只是嘗試過,並沒有得到它的工作,有一個錯誤代碼30 – Sahan 2014-10-01 11:54:46
我使用partials,它的工作,... – 2014-10-01 12:10:57
我會發布我所有的錯誤和文件在這裏,那麼你可能prob幫助我。 – Sahan 2014-10-01 12:27:58