22 lines
507 B
TypeScript
22 lines
507 B
TypeScript
import type { CapacitorConfig } from "@capacitor/cli";
|
|
|
|
const updateUrl = process.env.CAPACITOR_UPDATE_URL;
|
|
if (updateUrl && !updateUrl.startsWith("https://")) {
|
|
throw new Error("热更新接口必须使用 HTTPS");
|
|
}
|
|
|
|
const config: CapacitorConfig = {
|
|
appId: "com.imyeyu.gao.customer",
|
|
appName: "糕店管理",
|
|
webDir: "dist",
|
|
plugins: {
|
|
CapacitorUpdater: {
|
|
autoUpdate: updateUrl ? "atBackground" : false,
|
|
...(updateUrl ? { updateUrl } : {}),
|
|
statsUrl: ""
|
|
}
|
|
}
|
|
};
|
|
|
|
export default config;
|