minify.js 337 B

1234567891011
  1. const UglifyJS = require('uglify-js'),
  2. fs = require('fs'),
  3. package = require('../package.json');
  4. const banner = `/*! Sortable ${ package.version } - ${ package.license } | ${ package.repository.url } */\n`;
  5. fs.writeFileSync(
  6. `./Sortable.min.js`,
  7. banner + UglifyJS.minify(fs.readFileSync(`./Sortable.js`, 'utf8')).code,
  8. 'utf8'
  9. );