Uglify SyntaxError: Unexpected token: punc ())

前端 未结 8 979
甜味超标
甜味超标 2020-12-01 07:28

I am trying to use gulp in order to minify a folder containing JS files. However, one of the files has the above error, preventing it from being minified.

I managed

8条回答
  •  栀梦
    栀梦 (楼主)
    2020-12-01 07:40

    Add the babel-preset-es2015 dependency to fix this.

    And also add 'es2015' in .babelrc file.

    json
    {
        "presets": ["es2015"]
    }
    

提交回复
热议问题