【问题标题】:Ionic and Capacitor: How can i change the capacitor.config.ts file to a capacitor.config.json file?离子和电容器:如何将电容器.config.ts 文件更改为电容器.config.json 文件?
【发布时间】:2022-01-13 17:23:36
【问题描述】:
我创建了一个带有电容器的 Angular/Ionic 项目。现在我想在我的电容器.config.json 中进行更改,但是这个文件丢失了?取而代之的是capacitor.config.ts?!
我需要 JSON 文件,否则特定插件不起作用!
这是我的目录和 package.json 的图片:
Directory and Files
package.json file
【问题讨论】:
标签:
json
angular
ionic-framework
config
capacitor
【解决方案1】:
Capacitor 3 允许拥有 .json、.js 或 .ts 配置文件。
npx cap init 如果安装了 typescript,命令将创建一个 .ts 文件
如果您不想要 .ts 文件,您可以删除它并创建一个 .json 文件,但无论配置文件扩展名是什么,一切都应该正常工作。