是否有一个工具来将现有的Cordova 3插件安装到Worklight 6.1应用程序中? [英] Is there a tool to install an existing Cordova 3 plugin into a Worklight 6.1 app?

查看:141
本文介绍了是否有一个工具来将现有的Cordova 3插件安装到Worklight 6.1应用程序中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Worklight 6.1使用Cordova 3.1。该文档显示了如何创建自己的Cordova插件,但我找不到任何有关如何将现有的Cordova 3样式插件安装到Worklight项目的信息。

Worklight 6.1 uses Cordova 3.1. The documentation shows how to author your own Cordova plugin but I can't find any information on how to install existing Cordova 3 style plugins into a Worklight project.

我试过安装JavaScript和本地组件,以及编辑config.xml类似于我在Worklight 6.0中做的,并在某些情况下工作。

I tried installing the JavaScript and native components, and editing config.xml similar to what I did with Worklight 6.0, and that works in some cases.

但我发现Cordova 3风格的插件通常使用Cordova插件管理实用程序编写,不一定只是添加到项目中。

But I find that Cordova 3 style plugins are typically authored with the Cordova plugin management utility in mind and can't necessarily be just added to a project as is.

我遇到的特殊问题是使用require()(期望cordova.require())插件代码添加到dojo项目。 require()正在解析为AMD require(),它立即无法加载cordova / exec

The particular problem I hit was with the use of require() (expecting cordova.require()) in plugin code added to a dojo project. require() was resolving to AMD require() which promptly failed to load "cordova/exec"

当Cordova插件管理工具用于将插件添加到Cordova项目,他们自动将插件的javascript包装在一个cordova.define()函数中,该函数通过require()(和一些其他函数)作为参数。所以Cordova 3插件的标准是使用require()没有限定。

When the Cordova plugin management tools are used to add the plugin to a Cordova project, they automatically wrap the plugin's javascript in a cordova.define() function that passes require() (and some other functions) as a parameter. So the standard for Cordova 3 plugins is to use require() without qualification.

我知道我可以在每次使用第三方插件时手动解决这个问题,但是想了解是否有任何有关将现有Cordova 3样式插件添加到Worklight项目中的指南或工具或做法

I know I can resolve this issue manually each time I use a third party plugin, but was wondering if there were any guides, or tools, or practices around adding existing Cordova 3 style plugins into a Worklight project

推荐答案

这一次没有针对您在Worklight 6.1.0中要求的指南,实践或工具。但是,至少应该写一些关于它的东西。

Unfortunately at this time there are no guides, practices or tools for what you are asking in Worklight 6.1.0. But perhaps something should be written about it at the very least.

这篇关于是否有一个工具来将现有的Cordova 3插件安装到Worklight 6.1应用程序中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆