build.js 577 B

12345678910111213141516
  1. var fs = require('fs')
  2. var path = require('path')
  3. var minify = require('minify')
  4. minify.optimize('lib/uint32.js', { returnName: true, callback: save('build/uint32.min.js') })
  5. fs.writeFileSync( 'build/uint32.js', fs.readFileSync('lib/uint32.js') )
  6. minify.optimize('lib/uint64.js', { returnName: true, callback: save('build/uint64.min.js') })
  7. fs.writeFileSync( 'build/uint64.js', fs.readFileSync('lib/uint64.js') )
  8. function save (filename) {
  9. return function (p) {
  10. console.log('Renaming ' + path.basename(p.name) + ' to ' + filename)
  11. fs.renameSync( p.name, filename )
  12. }
  13. }