简体   繁体   English

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

[英]How could RequireJS be used with a system like Joomla?

This is a theoretical question. 这是一个理论问题。

How would RequireJS be used with a system like Joomla with the directory structure (including ability to include scripts from components, plugins, etc) RequireJS如何与具有目录结构的Joomla这样的系统一起使用(包括包含来自组件,插件等的脚本的功能)

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

Or isn't RequireJS suitable for this kind of multi-tiered directory structure? 还是RequireJS不适合这种多层目录结构?

You can use paths config: 您可以使用路径配置:

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 用于大型应用程序的系统架构和堆栈 - System architecture and stack used for big applications 用Java开发应用程序的体系结构也可以与桌面和Web界面一起使用 - Architecture to develop an application in java that could be used with desktop and web interface too C# .NET“无法加载文件或程序集 System.Runtime” - C# .NET "Could not load file or assembly System.Runtime" java可以用来创建桌面应用程序,如Dropbox吗? - can java be used to create desktop apps like dropbox? 使用requirejs扩展Web应用程序 - Scaling web applications with requirejs 类似于Twitter的登录系统(是否在URL中传递参数?) - Twitter-like login system (passing parameters in URL?) 如何在这个系统内进行通信? - How to communicate within this system? 如何实施库存系统? - How to implement an inventory system? 谁能列出可以用于在移动设备中测试Web应用程序的自动化测试的不同类型吗? - Can anyone list what are the different types of automation testing could be used to test web application in mobile devices 从移动应用程序的URL中获取文件:如何管理运行Joomla的服务器端? - fetching a file from a url for mobile app: How to manage server side running Joomla?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM