title: Obfuscate/minify code in place for npm package publish
body: <p>I have dist directory that looks like this 
  <a href="https://i.stack.imgur.com/rmfDy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rmfDy.png" alt="dist directory"></a></p>
  
  <p>Requirements: The root and each folder has <code>.js</code> and <code>.d.ts</code> for typing. I want to ship this to npm after obfuscating/minifying (to avoid reverse engineering). I need this to happen <strong>in place</strong> (all the folder structure intact), and also <strong>preserve</strong> the <code>.d.ts</code>. I use this package internally to develop and 1. need the flexibility to look into each folder directory, and 2. use the defined types. </p>
  
  <p>What I've tried: I've tried webpack but since webpack minifies the whole codebase to one file, and does not preserve the typings file, I don't think it's the right choice. </p>
  
  <p>Question: Is there a way to achieve this? Ideally the directory itself would almost be unchanged, just the contents would be minified. Thanks!</p>