我想加載幾個RequireJS配置。在我的HTML我加載我的主要配置通過RequireJS - 加載多個配置文件
<script src="../lib/require.js" data-main="../app/requireConfig"></script>
一旦文件準備就緒,我想加載我所有的插件配置。所以,我創建了一個新的定義文件,該文件認爲,調用require.config
功能:
define(['sharedServices/logger'], function (logger) {
function configVideo() {
logger.info('Adding video modules');
require.config({
path: {
Capabilities: 'videoProvider/Capabilities',
VideoProviderEnums: 'videoProvider/VideoProviderEnums',
VideoProviderCommon: 'videoProvider/VideoProviderCommon',
VideoProviderInstance: 'videoProvider/VideoProviderInstance',
DummyVideoInstance: 'videoProvider/DummyProvider/DummyVideoInstance'
}
});
}
return {
configVideo: configVideo
};
})
不過,我得到以下錯誤:
Uncaught Error: Mismatched anonymous define() module: function (logger) {