title: Django compressor does not uglify javascript
body: <p>I wish to use <a href="https://django-compressor.readthedocs.io/en/stable/" rel="nofollow noreferrer">Django Compressor</a> to both minify and uglify my css and javascript. I have got it working such that I do an offline compression and all required javascript is compressed correctly.</p>
  
  <p>The problem is that it does not uglify the code. My settings:</p>
  
  <pre class="lang-py prettyprint-override"><code>STATICFILES_FINDERS = (
      "django.contrib.staticfiles.finders.FileSystemFinder",
      "django.contrib.staticfiles.finders.AppDirectoriesFinder",
      "compressor.finders.CompressorFinder",
  )
  COMPRESS_ENABLED = True
  COMPRESS_OFFLINE = True
  COMPRESS_YUGLIFY_BINARY = "yuglify"
  COMPRESS_YUGLIFY_JS_ARGUMENTS = "--mangle"
  </code></pre>
  
  <p><code>yuglify</code> is on my path. I tried running it manually on a file to test, ie:<code>yuglify file.js --mangle</code>. It turns out that <code>yuglify</code> (which is a wrapper around <a href="https://www.npmjs.com/package/uglify-js" rel="nofollow noreferrer">uglify-js</a>) does not support <code>es6</code> and above.</p>
  
  <p>I found another uglifier called <a href="https://github.com/terser-js/terser" rel="nofollow noreferrer">terser</a> which works perfectly from the terminal with <code>es6</code> code. I therefore tried to replace the above settings with terser, ie:</p>
  
  <pre class="lang-py prettyprint-override"><code>COMPRESS_YUGLIFY_BINARY = "terser"
  COMPRESS_YUGLIFY_JS_ARGUMENTS = "--mangle"
  </code></pre>
  
  <p>This also does not work in <code>django-compressor</code>. The result is that the files get minified but not uglified.</p>
  
  <p>I would appreciate any suggestions on getting this working either with <code>django-compressor</code> or with an alternative package.</p>