mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
50 lines
965 B
TypeScript
50 lines
965 B
TypeScript
import { readFileSync } from 'node:fs';
|
|
import { resolve } from 'node:path';
|
|
|
|
import type { CapacitorConfig } from '@capacitor/cli';
|
|
import { KeyboardResize } from '@capacitor/keyboard';
|
|
|
|
const packageJson = JSON.parse(
|
|
readFileSync(resolve(__dirname, './package.json'), 'utf-8')
|
|
);
|
|
|
|
interface AppConfig {
|
|
affineVersion: string;
|
|
}
|
|
|
|
const config: CapacitorConfig & AppConfig = {
|
|
appId: 'app.affine.pro',
|
|
appName: 'AFFiNE',
|
|
webDir: 'dist',
|
|
affineVersion: packageJson.version,
|
|
ios: {
|
|
scheme: 'AFFiNE',
|
|
path: '.',
|
|
webContentsDebuggingEnabled: true,
|
|
},
|
|
server: {
|
|
// url: 'http://localhost:8080',
|
|
},
|
|
plugins: {
|
|
CapacitorCookies: {
|
|
enabled: false,
|
|
},
|
|
CapacitorHttp: {
|
|
enabled: false,
|
|
},
|
|
Keyboard: {
|
|
resize: KeyboardResize.None,
|
|
},
|
|
},
|
|
};
|
|
|
|
if (process.env.CAP_SERVER_URL) {
|
|
Object.assign(config, {
|
|
server: {
|
|
url: process.env.CAP_SERVER_URL,
|
|
},
|
|
});
|
|
}
|
|
|
|
export default config;
|