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

支持动态获取combine配置 #15

Closed
otakustay opened this issue Dec 30, 2013 · 2 comments
Closed

支持动态获取combine配置 #15

otakustay opened this issue Dec 30, 2013 · 2 comments

Comments

@otakustay
Copy link
Member

现在的combile配置是必须写在module.conf中的,但是一个系统如果超过200个文件,会导致module.conf非常大,写在一个文件中的配置也不容易维护

因此,项目会有需求分模块、分业务地写多个配置,在build时期再把这些配置合并起来

个人建议,在edp-build-config.js中可以额外提供一个getCombineConfig方法,返回的对象即为合并的配置,如果没有此方法,保持原逻辑默认使用module.conf

@leeight
Copy link
Member

leeight commented Feb 12, 2014

@otakustay

因为combine主要是给ModuleCompiler用的,因此这样子支持是否可以?

new ModuleCompiler( {
    exclude: ['src/common/js/jquery-*.min.js'],
    configFile: 'module.conf',
    entryExtnames: moduleEntries,
    getCombineConfig: function() {
        // blablabla...
    }
})

@otakustay
Copy link
Member Author

可以,但建议getCombineConfig添加一个参数,就是module.conf里的那个配置,这样这个函数可以基于那边的配置来做进一步处理返回结果,默认实现是直接返回参数

leeight added a commit that referenced this issue Feb 12, 2014
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