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

设置forwardDeclaration的bug #5

Open
vaseala opened this issue Oct 25, 2015 · 2 comments
Open

设置forwardDeclaration的bug #5

vaseala opened this issue Oct 25, 2015 · 2 comments

Comments

@vaseala
Copy link

vaseala commented Oct 25, 2015

设置过

fis.hook('commonjs', {
                forwardDeclaration: true,
                skipBuiltinModules: true
            });

之后构建文件

构建前:

var $ = require('jquery/1.11.3:exports/jquery');
module.exports = $;

构建后:

define('jquery', [], function(require, exports, module) {

  var $ = require('jquery/1.11.3:exports/jquery');
  module.exports = $;

});

期望值:

define('jquery', ['jquery/1.11.3:exports/jquery'], function(require, exports, module) {

  var $ = require('jquery/1.11.3:exports/jquery');
  module.exports = $;

});
@vaseala
Copy link
Author

vaseala commented Oct 25, 2015

问题补充:
对于require没有命名空间的文件,构建后是正常的

eg:

var $ = require('jquery');
module.exports = $;

构建后:

define('$', ['jquery'], function(require, exports, module) {

  var $ = require('jquery');
  module.exports = $;

});

这种是属于我期望的结果

@2betop
Copy link
Contributor

2betop commented Oct 27, 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

No branches or pull requests

2 participants