jjzjj

cordova-cli

全部标签

javascript - 如何在目录模式下更改 babel-cli 输出的文件名?

背景:我有一些用ES2015编写的测试,但由于v2.1中的QtWebKit缺少ES2015支持,因此需要将其转换为ES5才能在PhantomJS中运行。2.5beta应该支持它。babel-cli:我可以使用babel-cli将测试转换为ES5:babelmain.test.js--out-filemain.test.es5.js为了转换脚本目录,我可以使用:babeltests--out-dircompiled-tests这会将转译后的测试脚本输出到compiled-tests目录。如果我使用相同的目录,它会覆盖原来的目录,所以我们不希望这样。问题:有没有办法在babel-cli的目

javascript - RequireJS 文本插件的 PhoneGap/cordova 问题

我正在尝试通过PhoneGap运行一个简单的Web项目.该网站使用RequireJS异步加载模块。它还具有Handlebars我通过RequireJStextplugin加载的模板.当从本地HTTP服务器提供服务时,站点工作正常。但是在设备上它无法呈现。在PhoneGap上调试很棘手(虽然canbedonetosomeextent),但据我所知,问题与使用RequireJS文本插件加载这些模板有关。PhoneGap提供的基于weinre的调试器在控制台中显示错误字符串:JSCallbackError:Requestfailed.谁能推荐一个解决方案? 最佳答

javascript - 双指缩放 Cordova

如何为cordovaandroid项目实现双指缩放我有一个iframe,我正在其中加载我的src我想在iframe上实现双指缩放,因为它占据了整个屏幕 最佳答案 准确地说,您可以通过两种方式实现双指缩放Ifyouopentheimageinanativecontainerwhichallowszoomandpinch-theperformanceisfarbetter,hereyoumightneedaCordovapluginwhichcandothatforyou,ifoundhttps://github.com/keensof

javascript - Cordova 错误 : Refused to execute inline script because it violates the following Content Security Policy directive

我正在学习将Cordova与jquerymobile结合使用,但出现以下错误:RefusedtoexecuteinlinescriptbecauseitviolatesthefollowingContentSecurityPolicydirective:"default-src'self'data:gap:https://ssl.gstatic.com'unsafe-eval'".Eitherthe'unsafe-inline'keyword,ahash('sha256-iacGaS9lJJpFDLww4DKQsrDPQ2lxppM2d2GGnzCeKkU='),oranonce('n

javascript - Vue 3 CLI - 如何为 Object.entries 添加 babel polyfill

我有一个依赖项(vue2-google-maps),它导致我的Vue应用程序在旧版浏览器中出现问题,并引发Object.entries错误。阅读VueCLIDocsonpolyfills,我看到它提到尝试在babel.config.js中加载polyfill。我的babel.config.js:module.exports={presets:[['@vue/app',{polyfills:['es6.object']}]]}抛出错误:Modulebuildfailed(from./node_modules/babel-loader/lib/index.js):TypeError:[BA

javascript - 使用 Jest CLI 时如何让 Promises 工作?

我正在尝试使用JestCLI测试一个promise,这段代码在浏览器中运行时会正常执行。但是我想开始为它编写测试。classListCollection{constructor(){this.items=newArray();}addItem(string){constaddItemPromise=newPromise(function(resolve,reject){//setupasyncgettinglikeaXMLHttpRequestsetTimeout(()=>{this.items.push(string);resolve(string);}.bind(this),200

javascript - 如何为 rc5 配置 angular-cli 项目?

尝试安装angular-cli以使用angular2rc5,我遇到了一些错误:找不到名称“Promise”我已经安装了“npminstall-gangular-cli@webpack”,但他似乎没有安装typings,所以webstorm不知道“Promise”。我尝试过但没有成功的:1.我安装了“npminstalltypings--save”但没有任何变化。2.在我启用的webstorm项目配置中:(没有帮助)1.Usetypescriptservice(Experimental)2.Enabletypescriptcompiler2.1Trackchanges2.2.Usetsc

javascript - 脚本不从 .angular-cli.json 加载

我将新脚本添加到我的.angular-cli.json文件中,如下所示:"apps":[{"root":"src","outDir":"dist","assets":["assets","favicon.ico"],"index":"index.html","main":"main.ts","polyfills":"polyfills.ts","test":"test.ts","tsconfig":"tsconfig.app.json","testTsconfig":"tsconfig.spec.json","prefix":"app","styles":["../node_modul

javascript - 在 AngularJS 中放置 Cordova/Phonegap 事件的最佳位置

我有一个AngularJSCordova应用程序,目前一切都非常顺利。我的下一步是将Cordova插件添加到应用程序中,例如CordovaConnect插件,以检查网络连接是否打开并监听网络事件。计划是监听这些网络事件并询问连接插件设备是否连接到互联网,如果没有我将重定向到错误页面。我正在努力在我的AngularJS应用程序中找到一个位置,以便在应用程序启动时注册这些事件。它们应该在主运行block、配置block中还是在某种工厂/服务/提供者中?你们要把这些外部AngularJS设备事件放在哪里?外汇。document.addEventListener("online",yourCa

javascript - Apache Cordova 混合应用程序中的 ES6 模块/导入抛出 MIME 类型错误

我正在尝试在使用ApacheCordova构建的混合移动应用程序中使用ES6模块。不幸的是,Cordova似乎在提供没有MIME类型的模块,这会在WebView中引发错误(在Chrome63和64beta中)。具体来说,部署的应用程序(使用chromeremotedebugger)抛出以下错误:Failedtoloadmodulescript:Theserverrespondedwithanon-JavaScriptMIMEtypeof"".StrictMIMEtypecheckingisenforcedformodulescriptsperHTMLspec.我使用的是标准ES6导入,