Search code examples
grailsasset-pipelinegrails-plugin

Grails Asset Pipeline - minifyJs set to true not working


I used grails asset pipeline plugin to minify my application (I don't have any problem when running grails run-app) the problem arises when I'm going to generate a war file to deploy into tomcat server.

Currently using ':asset-pipeline:1.9.9'

currently My Config.groovy has this setup

grails.assets.minifyJs = true
grails.assets.minifyCss = true
grails.assets.bundle = true

The Particular problem here is when I'm going to set minifyJs = true

when I'm going to set minifyJs = false there's no error but my war file are not going to work when deployed to tomcat server.

| Error 2016-03-13 01:50:16,590 [main] ERROR pipeline.AssetCompiler  - Uglify JS Exception 
Message: [object Object] (/application/target/work/resources/uglifyjs/lib/parse-js.js#273)
Line | Method ->>  273 | _c_js_error_13 in org.mozilla.javascript.gen._application_target_work_resources_uglifyjs_lib_parse_js_js_2

I don't know whats going on or I missed something?


Solution

  • Immediately above the error message lines you quoted should be lines like this:

    | Processing File 851 of 888 - jquery/src/intro.js
    | Uglifying File 851 of 888 - jquery/src/intro
    

    Whatever javascript file that is mentioned there probably has either some syntax error, or possibly weird non-ascii characters that were introduced because of file encoding issues or something.