Leaflet/Jakefile.js

32 lines
907 B
JavaScript
Raw Normal View History

2011-12-12 18:44:16 +08:00
var build = require('./build/build.js');
2011-12-12 08:32:53 +08:00
var COPYRIGHT = "/*\n Copyright (c) 2010-2011, CloudMade, Vladimir Agafonkin\n" +
" Leaflet is a modern open source JavaScript library for interactive maps.\n" +
" http://leaflet.cloudmade.com\n*/\n";
task('build', function (compsBase32, buildName) {
var name = buildName || 'custom',
savePath = 'dist/leaflet' + (compsBase32 ? '-' + name : '') + '.js';
2011-12-12 08:32:53 +08:00
2011-12-12 18:44:16 +08:00
var files = build.getFiles(compsBase32);
2011-12-12 08:32:53 +08:00
console.log('Concatenating ' + files.length + ' files...');
2011-12-12 18:44:16 +08:00
var content = build.combineFiles(files);
console.log('Uncompressed size: ' + content.length);
console.log('Compressing...');
2011-12-12 08:32:53 +08:00
2011-12-12 18:44:16 +08:00
var compressed = COPYRIGHT + build.uglify(content);
2011-12-12 08:32:53 +08:00
console.log('Compressed size: ' + compressed.length);
2011-12-12 18:44:16 +08:00
build.save(savePath, compressed);
console.log('Saved to ' + savePath);
});
2011-12-12 08:32:53 +08:00
task('default', ['build']);
// TODO task('lint')