Uglify SyntaxError: Unexpected token: punc ())

前端 未结 8 963
甜味超标
甜味超标 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:57

    I am having the same issue, i found a great answers here that helped me to reach the the file that was causing the error.

    Go to Rails Console and Paste:

    JS_PATH = "app/assets/javascripts/**/*.js";
    Dir[JS_PATH].each do |file_name|
      puts "\n#{file_name}"
      puts Uglifier.compile(File.read(file_name))
    end
    

    Hope it helps someone!

提交回复
热议问题