cordova - 更改 Cordova 的工作目录

标签 cordova ionic-framework

如何将 Apache Cordova 的工作目录更改为 www 以外的目录?换 <content src="src/index.html"/>在 config.xml 中不起作用。

最佳答案

以下是 ionic-cli 文档中关于 Serving an alternative document root 的说明

如果您想在浏览器中测试您的应用程序并且您使用的文件夹不是默认的 www,您可以在您的 ionic.project 文件中指定此文件夹。

例子:

{
  "name": "SmoothRiders",
   "gulpStartupTasks": [
    "watch"
  ],
  "documentRoot": "app",
  "watchPatterns": [
    "app/js/*",
    "!app/css/**/*"
  ]
}

关于cordova - 更改 Cordova 的工作目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27967372/

相关文章:

javascript - Ionic window.open 在 iOS 设备中不起作用

html - 为什么我的 css 容器不工作?

mysql - Ionic-Angularjs-Restful-webService 项目结构

angular - ionic 2 : Client certificate based authentication HTTP request

javascript - Kendo UI 不显示标题和 View

cordova - Phonegapcamera.getPicture - 第一次调用时没有回调

android - 运行 "cordova build android"- 无法找到属性 android :fontVariationSettings and android:ttcIndex

cordova - 在 Cordova 5.0.0 中禁用同源策略

android - Windows 上的 ionic : Android SDK installed. 仍然得到 "Error: Please install Android target: "android-22"

javascript - TypeScript 中的数组与字符串声明