samaxes / minify-maven-plugin

Combine and minimize JavaScript and CSS files for faster page loading.
http://samaxes.github.com/minify-maven-plugin
Apache License 2.0
222 stars 90 forks source link

async/await not working #169

Open LucasE2996 opened 4 years ago

LucasE2996 commented 4 years ago

I am currently using async functions in my project, and when I tried to minify the code the following errors occurred:

[ERROR] missing ; before statement at js-1.0.0.js line 198:15
async function getAllManagers() {
               ^

[ERROR] missing ; before statement at js-1.0.0.js line 202:25
        result = await $.ajax({
                         ^

[ERROR] syntax error at js-1.0.0.js line 203:18
            type: 'GET',
                  ^

[ERROR] syntax error at js-1.0.0.js line 204:17
            url: host + '/get-all-manager',
                 ^

[ERROR] syntax error at js-1.0.0.js line 205:10
        });
          ^

[ERROR] invalid return at js-1.0.0.js line 207:15
        return result;
               ^

[ERROR] syntax error at js-1.0.0.js line 211:1
}
 ^

[ERROR] missing ; before statement at js-1.0.0.js line 220:25
        result = await $.ajax({
                         ^

[ERROR] syntax error at js-1.0.0.js line 221:18
            type: 'GET',
                  ^

[ERROR] syntax error at js-1.0.0.js line 222:17
            url: host + '/get-all-supervisor',
                 ^

[ERROR] syntax error at js-1.0.0.js line 223:10
        });
          ^

[ERROR] Compilation produced 11 syntax errors.

Version used: 1.7.6

blutorange commented 4 years ago

See https://github.com/samaxes/minify-maven-plugin/issues/168#issuecomment-504134244