Giter Site home page Giter Site logo

Minifying html, js and css about leanify HOT 2 OPEN

jayxon avatar jayxon commented on May 29, 2024 5
Minifying html, js and css

from leanify.

Comments (2)

JayXon avatar JayXon commented on May 29, 2024

Yes, I would love to add those.
The problem is, I don't want to reinvent the wheel to implement yet another html/js/css minifier (I also don't have enough knowledge about these formats to do it), but existing good minifiers (html-minifier, UglifyJS2, csso) are written in javascript.
If anyone know any good C/C++ implementations (low-level parser that support both read/write would also be very helpful), please let me know.
Or, if anyone have good knowledge of these formats are willing to implement it in C/C++, I'm happy to help.

For now, Leanify can only optimize embedded images in Data URI in these files, which I don't think any of those existing minifiers can do. So you probably want to use an existing good minifiers and Leanify together to get the best possible result.

from leanify.

JoeUX avatar JoeUX commented on May 29, 2024

Count me as another supporter of this idea. It would be awesome if you added web minification to Leanify. The XML minification you already do is pretty good, and made a big difference in File Optimizer for SVGs compared to HTML Tidy.

Yes, there are minifiers out there already, but there may be room for improvement. I'm seeing some dangerous bugs where content gets deleted. I don't know of a C or C++ implementation, but I know of one in Go and another in C# – these might be easier to navigate than JS, and C# is fairly similar to C/C++.

Mads' C# implementation: key source is in this folder.

Taco de Wolf's go implementation is here. He's deleting "unrequired" tags like html, head, and body, which is completely insane, but I'll talk to him when he gets back from vacation. (The HTML spec says that user agents should automatically infer those tags, but no one treats them as optional – we need them for all sorts of purposes, like metadata, Open Graph, etc.)

from leanify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.