【发布时间】:2015-02-14 06:49:45
【问题描述】:
我想知道是否有任何 JavaScript uglifier 可以排除文件的部分。
就像在这个块中一样,我只希望它在开发环境中:
// If s is undefined warn the DEV guys they forgot something!
if(s === undefined)
throw new Error('Invalid i18n key');
我可以通过向条件添加一个全局变量来停止错误,但是让它排除带有一些元数据的块会很酷:
/* UGLIFY exclude */
// If s is undefined warn the DEV guys they forgot something!
if(path === undefined)
throw new Error('Invalid i18n key, on' + current.parser.lineNo);
/* /UGLIFY */*
他们中的任何一个都可以做到这一点吗?
提前致谢!
【问题讨论】:
标签: javascript minify bundling-and-minification uglifyjs