문제

How to use UglifyJS to uglify a userscript but keep the header ? I have tried --comments option, but not working

// ==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==
도움이 되었습니까?

해결책

This option is working

uglifyjs script.js --comments "/@.*|==\/?UserScript==/"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top