mobile-query-three-www-vendor-bootstrap-docs-build-node-modules-hogan.js-tools-release.js / js
\n* @preserve Copyright 2012 Twitter, Inc.\n* @license http://www.apache.org/licenses/LICENSE-2.0.txt\n*/\n'; function read(path) { return fs.readFileSync(path).toString() }// Good enough for little js files function copy(src, dst) { return fs.writeFileSync(dst, read(src)); } function uglify(src, dst) { var jsp = require("uglify-js").parser; var pro = require("uglify-js").uglify; var orig_code = read(src); var ast = jsp.parse(orig_code); // parse code and get the initial AST ast = pro.ast_mangle(ast); // get a new AST with mangled names ast = pro.ast_squeeze(ast); // get an AST with compression optimizations fs.writeFileSync(dst, minlicense + pro.gen_code(ast)); } var packageJSON = JSON.parse(read('package.json')); var version = packageJSON.version.substring(0, packageJSON.version.indexOf('-')); function removeFirstComment(text) { return text.substring(text.indexOf('*/') + 2); } var context = { template: removeFirstComment(read(__dirname + '/../lib/template.js')), compiler: removeFirstComment(read(__dirname + '/../lib/compiler.js')) }; var wrapperPath = '/../wrappers/'; var wrappers = fs.readdirSync(__dirname + wrapperPath).map(function(f) { return __dirname + wrapperPath + f; }); var distPath = __dirname + '/../dist/'; wrappers.forEach(function(wrapper) { var tail = path.basename(wrapper, '.mustache'); var target = distPath + 'hogan-' + version + '.' + tail; var uglified = distPath + 'hogan-' + version + '.min.' + tail; fs.writeFileSync(target, Hogan.compile(read(wrapper)).render(context)); uglify(target, uglified); }); // Also release Hogan.Template on its own. var templateTarget = distPath + 'template-' + version + '.js'; fs.writeFileSync(templateTarget, read(__dirname + '/../lib/template.js')); uglify(templateTarget, distPath + 'template-' + version + '.min.js'); // Add packageJSON to node distribution packageJSON.version = version; fs.writeFileSync(__dirname + '/../dist/nodejs/package.json', JSON.stringify(packageJSON, null, " "));
[]readme course(s) prefaceI 1 2II 3 4III 5 6 7IV 8 9 10V 11 12 afterthought(s)appendix reference(s) example(s)resource(s) _![]()
(C) Æliens 04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.