netlify.js 352 B

1234567891011121314
  1. const path = require('path');
  2. const sh = require('shelljs');
  3. const files = ['dist', 'index.html'];
  4. const deployDir = 'deploy';
  5. // cleanup previous deploy
  6. sh.rm('-rf', deployDir);
  7. // make sure the directory exists
  8. sh.mkdir('-p', deployDir);
  9. // copy over dist, and html files
  10. files
  11. .forEach((file) => sh.cp('-r', file, path.join(deployDir, file)));