Skip to content

Commit 9aa723d

Browse files
committed
cleanup Jakefile
1 parent 4edfaee commit 9aa723d

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

Jakefile.js

+15-13
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
var build = require('./build/build.js'),
2-
lint = require('./build/hint.js');
2+
lint = require('./build/hint.js');
33

44
var COPYRIGHT = '/*\n Copyright (c) 2010-2012, CloudMade, Vladimir Agafonkin\n' +
5-
' Leaflet is a modern open-source JavaScript library for interactive maps.\n' +
5+
' Leaflet is an open-source JavaScript library for mobile-friendly interactive maps.\n' +
66
' http://leaflet.cloudmade.com\n*/\n';
77

88
desc('Check Leaflet source for errors with JSHint');
99
task('lint', function () {
10+
1011
var files = build.getFiles();
1112

1213
console.log('Checking for JS errors...');
@@ -23,19 +24,19 @@ task('lint', function () {
2324

2425
desc('Combine and compress Leaflet source files');
2526
task('build', ['lint'], function (compsBase32, buildName) {
26-
var pathPart = 'dist/leaflet' + (buildName ? '-' + buildName : ''),
27-
srcPath = pathPart + '-src.js',
28-
path = pathPart + '.js';
2927

3028
var files = build.getFiles(compsBase32);
3129

3230
console.log('Concatenating ' + files.length + ' files...');
33-
34-
var content = build.combineFiles(files);
3531

36-
var oldSrc = build.load(srcPath),
37-
newSrc = COPYRIGHT + content,
38-
srcDelta = build.getSizeDelta(newSrc, oldSrc);
32+
var content = build.combineFiles(files),
33+
newSrc = COPYRIGHT + content,
34+
35+
pathPart = 'dist/leaflet' + (buildName ? '-' + buildName : ''),
36+
srcPath = pathPart + '-src.js',
37+
38+
oldSrc = build.load(srcPath),
39+
srcDelta = build.getSizeDelta(newSrc, oldSrc);
3940

4041
console.log('\tUncompressed size: ' + newSrc.length + ' bytes (' + srcDelta + ')');
4142

@@ -48,9 +49,10 @@ task('build', ['lint'], function (compsBase32, buildName) {
4849

4950
console.log('Compressing...');
5051

51-
var oldCompressed = build.load(path),
52-
newCompressed = COPYRIGHT + build.uglify(content),
53-
delta = build.getSizeDelta(newCompressed, oldCompressed);
52+
var path = pathPart + '.js',
53+
oldCompressed = build.load(path),
54+
newCompressed = COPYRIGHT + build.uglify(content),
55+
delta = build.getSizeDelta(newCompressed, oldCompressed);
5456

5557
console.log('\tCompressed size: ' + newCompressed.length + ' bytes (' + delta + ')');
5658

0 commit comments

Comments
 (0)