New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何通过YUI Commpressor来压缩我的module #331

Closed
iamcarlchen opened this Issue Aug 21, 2012 · 3 comments

Comments

Projects
None yet
4 participants
@iamcarlchen

我是盛大的前端工程师,目前在用seajs写一个web项目,框架很好用,但是我写了一个module,大概有将近800行,想用YUI Commpressor压缩,但是压缩后,require, export等变量也hash了,这样导致,seajs无法辨认,请问有什么其他方式可以进行压缩代码?谢谢

@j1anb1n

This comment has been minimized.

Show comment
Hide comment
@j1anb1n

j1anb1n Aug 21, 2012

https://github.com/mishoo/UglifyJS/
试试--reserved-names这个参数

j1anb1n commented Aug 21, 2012

https://github.com/mishoo/UglifyJS/
试试--reserved-names这个参数

@lifesinger

This comment has been minimized.

Show comment
Hide comment
@lifesinger

lifesinger Aug 22, 2012

Member

建议用 spm 压缩: �https://github.com/seajs/spm

Member

lifesinger commented Aug 22, 2012

建议用 spm 压缩: �https://github.com/seajs/spm

@lifesinger lifesinger closed this Aug 22, 2012

@julabs

This comment has been minimized.

Show comment
Hide comment
@julabs

julabs Oct 26, 2012

如果用YUI Commpressor压缩,可以在函数体内加上"require:nomunge,exports:nomunge,module:nomunge";,如

define(function(require,exports,module){
    "require:nomunge,exports:nomunge,module:nomunge";
});

这样YUI Commpressor就不会替换require、exports、module三个参数了,可以参考http://julabs.com/blog/yui-compressor-seajs-single-module/。

julabs commented Oct 26, 2012

如果用YUI Commpressor压缩,可以在函数体内加上"require:nomunge,exports:nomunge,module:nomunge";,如

define(function(require,exports,module){
    "require:nomunge,exports:nomunge,module:nomunge";
});

这样YUI Commpressor就不会替换require、exports、module三个参数了,可以参考http://julabs.com/blog/yui-compressor-seajs-single-module/。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment