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

require.config 输出错误 #42

Open
musicode opened this issue May 18, 2014 · 3 comments
Open

require.config 输出错误 #42

musicode opened this issue May 18, 2014 · 3 comments

Comments

@musicode
Copy link

某些项目无法便利的在 index.html 统一设置 require.config,而是根据接入方的需要,自行添加,比如:

require.config({
    paths: {
         xxx: 'xxx'
    }
});

edp build 会输出成:

require.config({
    baseUrl: '',
    paths: {
         xxx: 'xxx'
    }
});

这样就改写了原来的配置

@otakustay
Copy link
Member

我这也有类似的问题,经典的是require.config在外部的.js文件中,我认为外部文件里就不要改baseUrl了,现在虽然可以用file meta搞但似乎不改才是比较正常的决定

@leeight
Copy link
Member

leeight commented May 19, 2014

如果不修改的话,可能也会有问题,比如PathMapper把src改成了asset。

@hushicai
Copy link

我觉得不需要改baseUrl,在知心中间页上,baseUrl是类似这样的:

require.config({
    baseUrl: '{%$tplData.feRoot%}/src'
});

edp build或者edp import后,会把它改成这样:

require.config({
    baseUrl: '../src',
    packages: [...]
});

这就出问题了,又得手工改回去。。。

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

4 participants