2014-03-07 29 views
1

如何使用UglifyJS uglify用户脚本但保留标题?我曾尝试--comments选项,但不是工作UglifyJS保留用户标题

// ==UserScript== 
// @name  Google Translate Tooltip 
// @namespace steely.wing 
// @version  1.4 
// @description Translates selected text into a tooltip. 
// @license  GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html 
// @copyright 2014, Wing Leong (http://steelywing.iblogger.org/) 
// @include  * 
// @require  http://code.jquery.com/jquery-2.1.0.min.js 
// @grant  GM_getValue 
// @grant  GM_setValue 
// @grant  GM_xmlhttpRequest 
// ==/UserScript== 

回答

1

此选项工作

uglifyjs script.js --comments "/@.*|==\/?UserScript==/"