@@ -24,17 +24,14 @@ else {
24
24
25
25
console . log ( 'Build version: ' + newVersion ) ;
26
26
27
- /*
28
- * Get code docs
29
- */
27
+ // Get code docs
30
28
var documentation = fs . readFileSync ( mainScript , 'utf-8' ) . split ( '*/' ) [ 0 ] + '*/' ;
31
29
var docParts = documentation . split ( '@version ' ) ;
32
30
documentation = docParts [ 0 ] + '@version ' + newVersion + '\n' + docParts [ 1 ] . split ( '\n' ) [ 1 ] ;
33
31
34
32
35
33
/**
36
- * Create new minified version of a file and change
37
- * version number
34
+ * Create new minified version of a file and change version number
38
35
* @param {String } path
39
36
* @param {String } newName
40
37
*/
@@ -56,7 +53,13 @@ function buildFile(path, newName) {
56
53
} ) ;
57
54
}
58
55
56
+ // Minify main script
59
57
buildFile ( mainScript , mainMinifiedScript ) ;
58
+
59
+ // Put top documentation back into minified main script
60
+ fs . writeFileSync ( mainMinifiedScript , documentation + "\n" + fs . readFileSync ( mainMinifiedScript , 'utf-8' ) ) ;
61
+
62
+ // Minify modules and language files
60
63
[ jsPath , jsPath + 'lang/' ] . forEach ( function ( path ) {
61
64
fs . readdirSync ( path ) . forEach ( function ( fileName ) {
62
65
if ( fileName . substr ( - 7 ) == '.dev.js' ) {
@@ -66,7 +69,3 @@ buildFile(mainScript, mainMinifiedScript);
66
69
} ) ;
67
70
} ) ;
68
71
69
- /*
70
- * Add docs to main script
71
- */
72
- fs . writeFileSync ( mainMinifiedScript , documentation + "\n" + fs . readFileSync ( mainMinifiedScript , 'utf-8' ) ) ;
0 commit comments