cleanup Jakefile
This commit is contained in:
parent
4edfaee008
commit
9aa723d95b
26
Jakefile.js
26
Jakefile.js
@ -1,12 +1,13 @@
|
||||
var build = require('./build/build.js'),
|
||||
lint = require('./build/hint.js');
|
||||
lint = require('./build/hint.js');
|
||||
|
||||
var COPYRIGHT = '/*\n Copyright (c) 2010-2012, CloudMade, Vladimir Agafonkin\n' +
|
||||
' Leaflet is a modern open-source JavaScript library for interactive maps.\n' +
|
||||
' Leaflet is an open-source JavaScript library for mobile-friendly interactive maps.\n' +
|
||||
' http://leaflet.cloudmade.com\n*/\n';
|
||||
|
||||
desc('Check Leaflet source for errors with JSHint');
|
||||
task('lint', function () {
|
||||
|
||||
var files = build.getFiles();
|
||||
|
||||
console.log('Checking for JS errors...');
|
||||
@ -23,19 +24,19 @@ task('lint', function () {
|
||||
|
||||
desc('Combine and compress Leaflet source files');
|
||||
task('build', ['lint'], function (compsBase32, buildName) {
|
||||
var pathPart = 'dist/leaflet' + (buildName ? '-' + buildName : ''),
|
||||
srcPath = pathPart + '-src.js',
|
||||
path = pathPart + '.js';
|
||||
|
||||
var files = build.getFiles(compsBase32);
|
||||
|
||||
console.log('Concatenating ' + files.length + ' files...');
|
||||
|
||||
var content = build.combineFiles(files);
|
||||
var content = build.combineFiles(files),
|
||||
newSrc = COPYRIGHT + content,
|
||||
|
||||
var oldSrc = build.load(srcPath),
|
||||
newSrc = COPYRIGHT + content,
|
||||
srcDelta = build.getSizeDelta(newSrc, oldSrc);
|
||||
pathPart = 'dist/leaflet' + (buildName ? '-' + buildName : ''),
|
||||
srcPath = pathPart + '-src.js',
|
||||
|
||||
oldSrc = build.load(srcPath),
|
||||
srcDelta = build.getSizeDelta(newSrc, oldSrc);
|
||||
|
||||
console.log('\tUncompressed size: ' + newSrc.length + ' bytes (' + srcDelta + ')');
|
||||
|
||||
@ -48,9 +49,10 @@ task('build', ['lint'], function (compsBase32, buildName) {
|
||||
|
||||
console.log('Compressing...');
|
||||
|
||||
var oldCompressed = build.load(path),
|
||||
newCompressed = COPYRIGHT + build.uglify(content),
|
||||
delta = build.getSizeDelta(newCompressed, oldCompressed);
|
||||
var path = pathPart + '.js',
|
||||
oldCompressed = build.load(path),
|
||||
newCompressed = COPYRIGHT + build.uglify(content),
|
||||
delta = build.getSizeDelta(newCompressed, oldCompressed);
|
||||
|
||||
console.log('\tCompressed size: ' + newCompressed.length + ' bytes (' + delta + ')');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user