Skip to content
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

修改AMD转CMD时对依赖声明的处理方式 #3

Merged
merged 3 commits into from Jan 12, 2015

Conversation

zongwei007
Copy link
Contributor

对于AMD:

define(['a','b'],function(a){
...
});

原有的转换结果是:

define(['a','b'],function(require, exports, module){
    var a = require('a');
});

这里虽然不影响模块的加载,但对打包还是略有影响。
调整后的效果:

define(function(require, exports, module){
    var a = require('a');
    require('b');
});

@army8735
Copy link
Owner

army8735 commented Jan 5, 2015

好久不动我都快忘了……
这没跑过

具名模块存在模块ID,这个模块ID对于CMD而言几无意义。在默认一个文件只有一个AMD模块的前提下,这个ID应当去除。
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 76035a0 on zongwei007:master into 421bc22 on army8735:master.

army8735 added a commit that referenced this pull request Jan 12, 2015
修改AMD转CMD时对依赖声明的处理方式
@army8735 army8735 merged commit 55d889b into army8735:master Jan 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants