Comments (18)
- 1 for html
from express-minify.
ah ok, thought issues are only bugs here, thx mate.
--> just did some tests.. you're right, the best practice seems to be minifying + gzip
Then it would be nice to have support for all of them:
- Jade
- EJS
- plain HTML
from express-minify.
All feature requests are issues, not only problems, or bugs.
Just to be clear, html minification, with EJS or any other engine:
Code before:
<ul>
<li>A</li>
<li>B</li>
<li>C</li>
<li>D</li>
</ul>
Code after:
<ul><li>A</li><li>B</li><li>C</li><li>D</li></ul>
With any other render optimizations, of course.
from express-minify.
Minifying template is a good idea because it can be safely cached :-)
from express-minify.
@joeytwiddle it could be several params, because there cases you may want to minify css inside <style>
tags, or even javascript code on atributes...
cases like:
<a property="value"></a>
to
<a property=value></a>
or
<i class="icon-x"></i>
to
<i class="icon-x" />
....
from express-minify.
I really want to minify, because I make a lot of requests with pjax, and all the HTML comes with spacing...
from express-minify.
@marceloboeira Have you enabled gzip? According to those real world test results, gzip is really an effective way to reduce traffic.
from express-minify.
@breeswish yeap. but I guess html minification could help me even more.
from express-minify.
+1
from express-minify.
+1 for html output minify
from express-minify.
Support for jade would be nice!! I think that's what you want ;)
For 'normal HTML' GZIP is supported in express-minify
BTW this is a feature request and not an issue.. please move
from express-minify.
@faeb187 weird. heh
from express-minify.
I just want to warn, that occasionally HTML minification can change the meaning of a page! Specifically I experienced it when the browser was interpreting newlines as a gap, and the minifier removed those newlines (and indentation).
Given certain CSS settings (I forget which property now),
<span>
Thing
</span>
is equivalent to:
<span> Thing </span>
But if you minify it to
<span>Thing</span>
then the resulting output is different! (You have lost the gap.)
For that reason, we stopped using Jade's built-in minifier for production, and stuck with un-minified HTML, like we had in development mode.
This is a rare issue, but it might trip people up (although if they use the minifier in both dev and prod mode, then they should be ok).
from express-minify.
One other concern, if you are minifying but not caching, then you might be making the network transfer faster, but slowing down the actual response! This depends on the size of your HTML, and the speed of your minifier (related to CPU power of course). If you are caching semi-static pages, then this only applies to the first request, so no problem. And if it is optional, then the dev can make the decision for themself. Just wanted to warn about that too. ;)
from express-minify.
Bleugh, tired of waiting. Found https://www.npmjs.com/package/express-minify-html
It's not perfect, would love for regular express-minify to gain this ability...
from express-minify.
this is oooooooooooooold as hell. I haven't done JS since 2015. hahah a
from express-minify.
express-minify-html's last commit was in 2017 and now features a high severity vulnerability.
Let's just add basic HTML minification to regular express-minify.
from express-minify.
... and now features a high severity vulnerability.
Where would that be? e.g. no really.... citation is needed please.
Refs:
$ npm install
npm notice created a lockfile as package-lock.json. You should commit this file.
added 6 packages from 41 contributors and audited 7 packages in 0.524s
found 0 vulnerabilities
$ npm audit
=== npm audit security report ===
found 0 vulnerabilities
in 7 scanned packages
- Nothing found regarding this package back 36 pages to 2016 at https://www.npmjs.com/advisories.
- Nothing on GitHubs security parser.
from express-minify.
Related Issues (20)
- What's the reason why to remove blacklist support? HOT 3
- stylus not required when not loaded yet HOT 2
- NFR: Experimental branch for *UglifyJS2* HOT 10
- NFR: `catch` callbacks, emitters, or equivalent options HOT 9
- Add Brotli support HOT 1
- Middleware not hooked? HOT 1
- Typescript HOT 2
- gzipping should be done after minification HOT 2
- It's not working for me. HOT 41
- js_match.test is not a function HOT 1
- Basic Usage is not working HOT 2
- uglifyJS option and uglifyJS-X compatibility HOT 9
- Crash HOT 2
- CSS are minified, JS not HOT 1
- Question about file cache option HOT 3
- Error while installing on macOS 10.14.1 HOT 2
- How to skip minification for already minified assets? HOT 1
- CSS minifying issue
- Minify and uglify inline script
- `express-minify` +`terser` ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from express-minify.