From fedde48ea257ec69946c7b9a1f917be271049715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=A2=A6=E6=AC=A2?= Date: Tue, 3 Nov 2020 11:50:28 +0800 Subject: [PATCH] Improve documentation for the configure of package.json Signed-off-by: zhaomenghuan --- dev-packages/cli/README.md | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/dev-packages/cli/README.md b/dev-packages/cli/README.md index 287ec418cb98a..b14a04c1a4099 100644 --- a/dev-packages/cli/README.md +++ b/dev-packages/cli/README.md @@ -15,10 +15,11 @@ - [**Description**](#description) - [**Getting Started**](#getting-started) - [**Configure**](#configure) - - [**Build Target & Target Config**](#build-target-&-target-config) - [**Application Properties**](#application-properties) - [**Default Preferences**](#default-preferences) - [**Default Theme**](#default-theme) + - [**Build Target**](#build-target) + - [**Target Config**](#target-config) - [**Using Latest Builds**](#using-latest-builds) - [**Building**](#building) - [**Build**](#build) @@ -109,11 +110,30 @@ Default color and icon themes can be configured in `theia.frontend.config` secti }, ``` -### Build Target & Target Config +### Build Target The following targets are supported: `browser` and `electron`. By default `browser` target is used. The target can be configured in the `package.json` via `theia/target` property, e.g: +```json +{ + "theia": { + "target": "electron" + }, + "dependencies": { + "@theia/electron": "latest" + } +} +``` + +For `electron` target applications, is it mandatory to include **Electron** runtime dependencies. The `@theia/electron` package is the easiest way to install the necessary dependencies. + +### Target Config + +Application configuration for the frontend provides specific configurations for different target.There is an `electron` field configuration under `frontend.config` to configure the Electron target.The electron field currently supports the following configurations: +- disallowReloadKeybinding:If set to `true`, reloading the current browser window won't be possible with the `Ctrl/Cmd + R` keybinding. It is `false` by default. Has no effect if not in an electron environment. +- windowOptions:Override or add properties to the electron `windowOptions`. + ```json { "theia": { @@ -132,15 +152,10 @@ The target can be configured in the `package.json` via `theia/target` property, } } } - }, - "dependencies": { - "@theia/electron": "latest" } } ``` -For `electron` target applications, is it mandatory to include **Electron** runtime dependencies. The `@theia/electron` package is the easiest way to install the necessary dependencies. - ### Using Latest Builds If you set `next` in your theia config, then Theia will prefer `next` over `latest` as the latest tag.