title: Tomcat gzip compressed javascript files throws error
body: <p>I am using Tomcat as a web server by hosting web bundled files in ROOT folder of Tomcat server.</p>
  
  <p>I have angular project and I am building my production build by using webpack. In production build, to all my files I am compressing into gzip. </p>
  
  <p>for e.g.</p>
  
  <p>main.bundle.js converts to main.bundle.js.gz</p>
  
  <p>After conversion I change the file extension manually and remove .gz and save as .js.</p>
  
  <p>After deployment, on browser files are loading but it throws error.</p>
  
  <pre><code>Uncaught SyntaxError: Invalid or unexpected token
  </code></pre>
  
  <p>I am uploading the same bundle files to AWS S3 bucket. After uploading files, in S3 console by manually adding metadata of files as content-encoding: gzip it works very fine.</p>
  
  <p>I am struggling to understand do I need to add content-encoding metadata in each file manually before uploading it to Tomcat server? or I don't need to do that? or Am I doing anything wrong here?</p>