summaryrefslogtreecommitdiff
path: root/build-tools/lib/uglify-js.js
diff options
context:
space:
mode:
authorKibum Kim <kb0929.kim@samsung.com>2012-02-27 21:16:46 +0900
committerKibum Kim <kb0929.kim@samsung.com>2012-02-27 21:16:46 +0900
commit5304d4c62a76f7517fedcc510afbebe2239173a5 (patch)
tree98e10389e4ace91777bb691800b78bd5f716744d /build-tools/lib/uglify-js.js
downloadweb-ui-fw-5304d4c62a76f7517fedcc510afbebe2239173a5.tar.gz
web-ui-fw-5304d4c62a76f7517fedcc510afbebe2239173a5.tar.bz2
web-ui-fw-5304d4c62a76f7517fedcc510afbebe2239173a5.zip
tizen beta release
Diffstat (limited to 'build-tools/lib/uglify-js.js')
-rw-r--r--build-tools/lib/uglify-js.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/build-tools/lib/uglify-js.js b/build-tools/lib/uglify-js.js
new file mode 100644
index 00000000..972e9cf1
--- /dev/null
+++ b/build-tools/lib/uglify-js.js
@@ -0,0 +1,21 @@
+//convienence function(src, [options]);
+function uglify(orig_code, options){
+ options || (options = {});
+ var jsp = uglify.parser;
+ var pro = uglify.uglify;
+
+ var ast = jsp.parse(orig_code, options.strict_semicolons); // parse code and get the initial AST
+ ast = pro.ast_mangle(ast, options.mangle_options); // get a new AST with mangled names
+ ast = pro.ast_squeeze(ast, options.squeeze_options); // get an AST with compression optimizations
+ var final_code = pro.gen_code(ast, options.gen_options); // compressed code here
+ return final_code;
+};
+
+// Change path to clean up lib directory.
+// by Youmin Ha <youmin.ha@samsung.com>
+uglify.parser = require("./uglifyjs/parse-js");
+uglify.uglify = require("./uglifyjs/process");
+//uglify.parser = require("./lib/parse-js");
+//uglify.uglify = require("./lib/process");
+
+module.exports = uglify