Skip to content

Commit 92ed178

Browse files
committed
Added some documentation to the build file
1 parent 8351d6a commit 92ed178

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

build

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,14 @@ else {
2424

2525
console.log('Build version: '+newVersion);
2626

27-
/*
28-
* Get code docs
29-
*/
27+
// Get code docs
3028
var documentation = fs.readFileSync(mainScript, 'utf-8').split('*/')[0]+'*/';
3129
var docParts = documentation.split('@version ');
3230
documentation = docParts[0] +'@version '+newVersion+'\n'+docParts[1].split('\n')[1];
3331

3432

3533
/**
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
3835
* @param {String} path
3936
* @param {String} newName
4037
*/
@@ -56,7 +53,13 @@ function buildFile(path, newName) {
5653
});
5754
}
5855

56+
// Minify main script
5957
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
6063
[jsPath, jsPath+'lang/'].forEach(function(path) {
6164
fs.readdirSync(path).forEach(function(fileName) {
6265
if(fileName.substr(-7) == '.dev.js') {
@@ -66,7 +69,3 @@ buildFile(mainScript, mainMinifiedScript);
6669
});
6770
});
6871

69-
/*
70-
* Add docs to main script
71-
*/
72-
fs.writeFileSync(mainMinifiedScript, documentation+"\n"+fs.readFileSync(mainMinifiedScript, 'utf-8'));

0 commit comments

Comments
 (0)