yui / yuicompressor

YUI Compressor
http://yui.github.com/yuicompressor/
Other
3.01k stars 662 forks source link

Failed to compress valid JS (axios library) #336

Open tugibaev opened 4 years ago

tugibaev commented 4 years ago

Valid full size code:

$(document).ready(function () {
    $(".add-cart").click(function (event) {
        event.preventDefault();
        $entry = $(this).attr("data");
        $count = $("#numCount").val();

        axios.post("/cartadd/", {
            "entry": $entry,
            "count": $count
        })
        .then(function (html) {
                $("#dlgCartAddBody").html(html);
                $("#dlgCartAdd").modal();
            })
        .catch(function () {
                alert("error");
            });
    });
});

can't be compressed. May be .then( or .catch( problem... Axios is good use JS library for AJAX, but code can't be compressed...