title: How to copy handlebars files to dist folder
body: <p>I'm using Typescript, which compiles from <code>src/</code> to <code>lib/</code> folder, and Babel, which compiles from <code>lib/</code> to <code>dist/</code>.</p>
  
  <p>The issue I have is that I have <code>.handlebars</code> files within <code>src/email_templates/</code> that are not being copied over to <code>dist/</code> when I compile the app. Therefore when I run the app it fails with errors as <code>dist/email_templates/</code> does not exist.</p>
  
  <p>I'm using <code>nodemailer-handlebars</code> package and have tried moving the <code>email_templates/</code> folder to the project root directory and setting <code>viewPath</code> to the folder, however this also fails as the app is located in <code>var/www/api.my-domain.com/</code>. It seems that the fact that I have periods in <code>api.my-domain.com</code> folder name causes viewPath to fail with error:</p>
  
  <pre><code>TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
      at validateString (internal/validators.js:125:11)
      at Object.resolve (path.js:1080:7)
      at ExpressHandlebars._resolveLayoutPath (/var/www/api.my-domain.com/node_modules/express-handlebars/lib/express-handlebars.js:342:17)
      at ExpressHandlebars.&lt;anonymous&gt; (/var/www/api.my-domain.com/node_modules/express-handlebars/lib/express-handlebars.js:223:35)
  </code></pre>
  
  <p>Here's my package.json script to build the app:</p>
  
  <pre><code>"build": "tsc &amp;&amp; babel ./lib --out-dir ./dist ",
  </code></pre>
  
  <p>How can I change this so that it delete the current contents of <code>dist/email_templates</code> then copies the contents of <code>src/email_templates</code> to <code>dist/email_templates</code>?</p>