Skip to content

Add option to use ES.next syntax features for even smaller minified output #100

Description

@mathiasbynens

The option could be something like:

format: {
    es6: true
}

…or es2015 or a more generic esnext.


A simple example of what it would do:

var foo = function(a) {
  return a * 2;
};

…currently minifies to:

var foo=function(a){return a*2}

With ES.next syntax it could be:

var foo=a=>a*2

(Only watch out for function bodies that make use of the this binding.)

There’s far more things that could be done, e.g. string literals containing new line characters or lots of quotes could sometimes be shortened by using template strings, etc.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions