문제

Is there a way to render out minified html with Docpad? For reasons I'm too lazy to explain, grunt plugins are not a viable solution for me.

도움이 되었습니까?

해결책

It sure is possible. The CoffeeKup plugin will actually minify your HTML when generating on a production environment for you automatically, and I think the LessCSS plugin does this too.

Personally, I use CloudFlare to minify everything post-deployment: https://support.cloudflare.com/entries/22076718-How-do-I-minify-HTML-CSS-and-JavaScript-to-optimize-my-site-

However, you could also easily write a plugin to minify the content as well. You could base it off the Uglify plugin which minifies javascript files using uglify-js. The trick would be to just decide which node module you would like to do it with. Happy to help further on this path with additional questions and answers.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top