RequireJS如何与Joomla这样的系统一起使用?

时间:2011-11-04 16:49:00

标签: web-applications joomla requirejs

这是一个理论问题。

如何将RequireJS与Joomla等系统一起使用,具有目录结构(包括从组件,插件等包含脚本的能力)

/components/com_something/script/a.js
/components/com_other/script/b.js

或者不是RequireJS适合这种多层目录结构吗?

1 个答案:

答案 0 :(得分:3)

您可以使用路径配置:

require.config({
  baseUrl: '/components'
  paths: {
    something: 'com_something/script',
    other: 'com_other/script'
  }
});

require(['something/a', 'other/b'], function(a, b){
  // ...
});
相关问题