1
0
Prechádzať zdrojové kódy

amberc.js: use correct program file for minification

Manfred Kroehnert 11 rokov pred
rodič
commit
4faad8df1a
1 zmenil súbory, kde vykonal 7 pridanie a 3 odobranie
  1. 7 3
      bin/amberc.js

+ 7 - 3
bin/amberc.js

@@ -545,11 +545,11 @@ AmberC.prototype.compose_js_files = function() {
 		self.optimize();
 		return;
 	}
-	var program_files = [];
 	if (undefined !== defaults.output_dir) {
 		programFile = path.join(defaults.output_dir, programFile);
 	}
 
+	var program_files = [];
 	if (0 !== defaults.libraries.length) {
 		console.log('Collecting libraries: ' + defaults.libraries);
 		program_files.push.apply(program_files, defaults.libraries);
@@ -626,8 +626,12 @@ AmberC.prototype.optimize = function() {
 		});
 	}
 	if (defaults.closure_full && (undefined !== defaults.program)) {
-		console.log('Compiling ' + defaults.program + '.js file using Google closure compiler.');
-		self.closure_compile(defaults.program + '.js', defaults.program + '.min.js', optimization_done.add());
+		var programFile = defaults.program;
+		if (undefined !== defaults.output_dir) {
+			programFile = path.join(defaults.output_dir, programFile);
+		}
+		console.log('Compiling ' + programFile + '.js file using Google closure compiler.');
+		self.closure_compile(programFile + '.js', programFile + '.min.js', optimization_done.add());
 	}
 
 	always_resolve(optimization_done.add());