0

When 'grunt build' is run all the scripts are merged and minified. This produces a 'undefined' error because one of the scripts is missing a ; semicolon to properly end the script.

Basically we need such a option: https://github.com/gruntjs/grunt-contrib-concat#separator Which does not exist in grunt-contrib-uglify.

This error only appears if you have to do 'grunt build'.

sunpatel
  • 15
  • 1
  • 6
  • 1
    I don't think that option exists in the `uglify` task, I'm not sure what you can do about it other than either add the semicolons manually or use the `concat` task in addition to the `uglify` task. – Jordan Kasper Feb 13 '14 at 16:49

1 Answers1

0

I don't know what your task build does, but assume it's something close to "running everything", like $ grunt by itself would do...

@jakerella is right, uglify doesn't feature a separator as concat does.

I would use concat to concatenate the scripts with a separator of your choice (concat lets you do that) and then use uglify to minify whatever script concat concatenated.

Wallace Sidhrée
  • 11,221
  • 6
  • 47
  • 58