feat: support desktop build

This commit is contained in:
mrxiaozhuox committed 2022-01-24 08:55:52 +08:00
1 parent bdcc06648b
commit 0ff4881d54
2 files changed
+65 -39

No files matched your search

+3 -38
View File
@@ -20,44 +20,9 @@ pub struct ConfigOptsBuild {
#[structopt(long)]
pub example: Option<String>,
/// Optional pattern for the app loader script [default: None]
///
/// Patterns should include the sequences `{base}`, `{wasm}`, and `{js}` in order to
/// properly load the application. Other sequences may be included corresponding
/// to key/value pairs provided in `pattern_params`.
///
/// These values can only be provided via config file.
#[structopt(skip)]
#[serde(default)]
pub pattern_script: Option<String>,
/// Optional pattern for the app preload element [default: None]
///
/// Patterns should include the sequences `{base}`, `{wasm}`, and `{js}` in order to
/// properly preload the application. Other sequences may be included corresponding
/// to key/value pairs provided in `pattern_params`.
///
/// These values can only be provided via config file.
#[structopt(skip)]
#[serde(default)]
pub pattern_preload: Option<String>,
#[structopt(skip)]
#[serde(default)]
/// Optional replacement parameters corresponding to the patterns provided in
/// `pattern_script` and `pattern_preload`.
///
/// When a pattern is being replaced with its corresponding value from this map, if the value is
/// prefixed with the symbol `@`, then the value is expected to be a file path, and the pattern
/// will be replaced with the contents of the target file. This allows insertion of some big JSON
/// state or even HTML files as a part of the `index.html` build.
///
/// Trunk will automatically insert the `base`, `wasm` and `js` key/values into this map. In order
//// for the app to be loaded properly, the patterns `{base}`, `{wasm}` and `{js}` should be used
/// in `pattern_script` and `pattern_preload`.
///
/// These values can only be provided via config file.
pub pattern_params: Option<HashMap<String, String>>,
/// Build platform: support Web & Desktop [default: "web"]
#[structopt(long)]
pub platform: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, StructOpt)]