سؤال

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