pugjs / pug

Pug – robust, elegant, feature rich template engine for Node.js
https://pugjs.org
21.68k stars 1.95k forks source link

Document how minified client templates are #2767

Open strugee opened 7 years ago

strugee commented 7 years ago

It's unclear to me how good a job Pug does at minifying templates when generating client resources. The generated JS is pretty ugly, but it's unclear to me if it tries to optimize variable names, etc. as well. In other words, will running client JS through Uglify produce a better result? This should be in the docs.

strugee commented 7 years ago

Specifically, I think it would go best in the options section, in the description of pretty, but I don't feel strongly about it.

ForbesLindesay commented 7 years ago

If you are rendering on the client side, it would be worth running the compiled templates through something like uglifyjs.

Ultimately, the documentation needs a "guides" section, and this is something we should mention under the client side usage section.