diff --git a/.changes/config-restructure-rfc-5.md b/.changes/config-restructure-rfc-5.md index 0a05b531a031..4ccf1f16cbe8 100644 --- a/.changes/config-restructure-rfc-5.md +++ b/.changes/config-restructure-rfc-5.md @@ -9,7 +9,7 @@ Restructured Tauri config per [RFC#5](https://github.com/tauri-apps/rfcs/blob/f3 - Removed `package` object. - Renamed `tauri` object to `app`. - Moved `tauri.bundle` object to the top-level. -- Renamed `build.distDir` field to `frontendDist`. +- Renamed `build.distDir` field to `prodFrontend`. - Renamed `build.devPath` field to `devUrl` and will no longer accepts paths, it will only accept URLs. - Moved `tauri.pattern` to `app.security.pattern`. - Removed `tauri.bundle.updater` object, and its fields have been moved to the updater plugin under `plugins.updater` object. diff --git a/core/tauri-build/src/codegen/context.rs b/core/tauri-build/src/codegen/context.rs index 07ef7f4c02ea..c1bfd14b7d6e 100644 --- a/core/tauri-build/src/codegen/context.rs +++ b/core/tauri-build/src/codegen/context.rs @@ -10,7 +10,7 @@ use std::{ path::PathBuf, }; use tauri_codegen::{context_codegen, ContextData}; -use tauri_utils::config::{AppUrl, WebviewUrl}; +use tauri_utils::config::ProdFrontend; // TODO docs /// A builder for generating a Tauri application context during compile time. @@ -82,11 +82,11 @@ impl CodegenContext { let (config, config_parent) = tauri_codegen::get_config(&self.config_path)?; // rerun if changed - match &config.build.frontend_dist { - Some(AppUrl::Url(WebviewUrl::App(p))) => { + match &config.build.prod_frontend { + Some(ProdFrontend::Dist(p)) => { println!("cargo:rerun-if-changed={}", config_parent.join(p).display()); } - Some(AppUrl::Files(files)) => { + Some(ProdFrontend::Files(files)) => { for path in files { println!( "cargo:rerun-if-changed={}", diff --git a/core/tauri-codegen/src/context.rs b/core/tauri-codegen/src/context.rs index 36e645303063..7dbf2d2e5080 100644 --- a/core/tauri-codegen/src/context.rs +++ b/core/tauri-codegen/src/context.rs @@ -15,7 +15,7 @@ use tauri_utils::acl::capability::Capability; use tauri_utils::acl::plugin::Manifest; use tauri_utils::acl::resolved::Resolved; use tauri_utils::assets::AssetKey; -use tauri_utils::config::{AppUrl, Config, PatternKind, WebviewUrl}; +use tauri_utils::config::{Config, PatternKind, ProdFrontend}; use tauri_utils::html::{ inject_nonce_token, parse as parse_html, serialize_node as serialize_html_node, }; @@ -157,24 +157,21 @@ pub fn context_codegen(data: ContextData) -> Result match url { - AppUrl::Url(url) => match url { - WebviewUrl::External(_) | WebviewUrl::CustomProtocol(_) => Default::default(), - WebviewUrl::App(path) => { - let assets_path = config_parent.join(path); - if !assets_path.exists() { - panic!( - "The `{}` configuration is set to `{:?}` but this path doesn't exist", - if dev { "devPath" } else { "distDir" }, - path - ) - } - EmbeddedAssets::new(assets_path, &options, map_core_assets(&options, target))? + ProdFrontend::Url(_url) => Default::default(), + ProdFrontend::Dist(path) => { + let assets_path = config_parent.join(path); + if !assets_path.exists() { + panic!( + "The `{}` configuration is set to `{:?}` but this path doesn't exist", + if dev { "devPath" } else { "distDir" }, + path + ) } - _ => unimplemented!(), - }, - AppUrl::Files(files) => EmbeddedAssets::new( + EmbeddedAssets::new(assets_path, &options, map_core_assets(&options, target))? + } + ProdFrontend::Files(files) => EmbeddedAssets::new( files .iter() .map(|p| config_parent.join(p)) diff --git a/core/tauri-config-schema/schema.json b/core/tauri-config-schema/schema.json index 682f29abd410..b50805a7dc09 100644 --- a/core/tauri-config-schema/schema.json +++ b/core/tauri-config-schema/schema.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Config", - "description": "The Tauri configuration object. It is read from a file where you can define your frontend assets, configure the bundler and define a tray icon.\n\nThe configuration file is generated by the [`tauri init`](https://tauri.app/v1/api/cli#init) command that lives in your Tauri application source directory (src-tauri).\n\nOnce generated, you may modify it at will to customize your Tauri application.\n\n## File Formats\n\nBy default, the configuration is defined as a JSON file named `tauri.conf.json`.\n\nTauri also supports JSON5 and TOML files via the `config-json5` and `config-toml` Cargo features, respectively. The JSON5 file name must be either `tauri.conf.json` or `tauri.conf.json5`. The TOML file name is `Tauri.toml`.\n\n## Platform-Specific Configuration\n\nIn addition to the default configuration file, Tauri can read a platform-specific configuration from `tauri.linux.conf.json`, `tauri.windows.conf.json`, `tauri.macos.conf.json`, `tauri.android.conf.json` and `tauri.ios.conf.json` (or `Tauri.linux.toml`, `Tauri.windows.toml`, `Tauri.macos.toml`, `Tauri.android.toml` and `Tauri.ios.toml` if the `Tauri.toml` format is used), which gets merged with the main configuration object.\n\n## Configuration Structure\n\nThe configuration is composed of the following objects:\n\n- [`package`](#packageconfig): Package settings - [`app`](#appconfig): The Tauri config - [`build`](#buildconfig): The build configuration - [`plugins`](#pluginconfig): The plugins config\n\n```json title=\"Example tauri.config.json file\" { \"productName\": \"tauri-app\", \"version\": \"0.1.0\" \"build\": { \"beforeBuildCommand\": \"\", \"beforeDevCommand\": \"\", \"devUrl\": \"../dist\", \"frontendDist\": \"../dist\" }, \"app\": { \"security\": { \"csp\": null }, \"windows\": [ { \"fullscreen\": false, \"height\": 600, \"resizable\": true, \"title\": \"Tauri App\", \"width\": 800 } ] }, \"bundle\": {} } ```", + "description": "The Tauri configuration object. It is read from a file where you can define your frontend assets, configure the bundler and define a tray icon.\n\nThe configuration file is generated by the [`tauri init`](https://tauri.app/v1/api/cli#init) command that lives in your Tauri application source directory (src-tauri).\n\nOnce generated, you may modify it at will to customize your Tauri application.\n\n## File Formats\n\nBy default, the configuration is defined as a JSON file named `tauri.conf.json`.\n\nTauri also supports JSON5 and TOML files via the `config-json5` and `config-toml` Cargo features, respectively. The JSON5 file name must be either `tauri.conf.json` or `tauri.conf.json5`. The TOML file name is `Tauri.toml`.\n\n## Platform-Specific Configuration\n\nIn addition to the default configuration file, Tauri can read a platform-specific configuration from `tauri.linux.conf.json`, `tauri.windows.conf.json`, `tauri.macos.conf.json`, `tauri.android.conf.json` and `tauri.ios.conf.json` (or `Tauri.linux.toml`, `Tauri.windows.toml`, `Tauri.macos.toml`, `Tauri.android.toml` and `Tauri.ios.toml` if the `Tauri.toml` format is used), which gets merged with the main configuration object.\n\n## Configuration Structure\n\nThe configuration is composed of the following objects:\n\n- [`package`](#packageconfig): Package settings - [`app`](#appconfig): The Tauri config - [`build`](#buildconfig): The build configuration - [`plugins`](#pluginconfig): The plugins config\n\n```json title=\"Example tauri.config.json file\" { \"productName\": \"tauri-app\", \"version\": \"0.1.0\" \"build\": { \"beforeBuildCommand\": \"\", \"beforeDevCommand\": \"\", \"devUrl\": \"../dist\", \"prodFrontend\": { \"dist\": \"../dist\" }, }, \"app\": { \"security\": { \"csp\": null }, \"windows\": [ { \"fullscreen\": false, \"height\": 600, \"resizable\": true, \"title\": \"Tauri App\", \"width\": 800 } ] }, \"bundle\": {} } ```", "type": "object", "properties": { "$schema": { @@ -1097,18 +1097,18 @@ ] }, "devUrl": { - "description": "The URL to load in development.\n\nThis is usually an URL to a dev server, which serves your application assets with hot-reload and HMR. Most modern JavaScript bundlers like [vite](https://vitejs.dev/guide/) provides a way to start a dev server by default.\n\nIf you don't have a dev server or don't want to use one, ignore this option and use [`frontendDist`](BuildConfig::frontend_dist) and point to a web assets directory, and Tauri CLI will run its built-in dev server and provide a simple hot-reload experience.", + "description": "The URL to load in development.\n\nThis is usually an URL to a dev server, which serves your application assets with hot-reload and HMR. Most modern JavaScript bundlers like [vite](https://vitejs.dev/guide/) provides a way to start a dev server by default.\n\nIf you don't have a dev server or don't want to use one, ignore this option and use [`prodFrontend`](BuildConfig::prod_frontend) and point to a web assets directory, and Tauri CLI will run its built-in dev server and provide a simple hot-reload experience.", "type": [ "string", "null" ], "format": "uri" }, - "frontendDist": { + "prodFrontend": { "description": "The path to the application assets (usually the `dist` folder of your javascript bundler) or a URL that could be either a custom protocol registered in the tauri app (for example: `myprotocol://`) or a remote URL (for example: `https://site.com/app`).\n\nWhen a path relative to the configuration file is provided, it is read recursively and all files are embedded in the application binary. Tauri then looks for an `index.html` and serves it as the default entry point for your application.\n\nYou can also provide a list of paths to be embedded, which allows granular control over what files are added to the binary. In this case, all files are added to the root and you must reference it that way in your HTML files.\n\nWhen a URL is provided, the application won't have bundled assets and the application will load that URL by default.", "anyOf": [ { - "$ref": "#/definitions/AppUrl" + "$ref": "#/definitions/ProdFrontend" }, { "type": "null" @@ -1161,23 +1161,51 @@ }, "additionalProperties": false }, - "AppUrl": { + "ProdFrontend": { "description": "Defines the URL or assets to embed in the application.", - "anyOf": [ + "oneOf": [ { - "description": "The app's external URL, or the path to the directory containing the app assets.", - "allOf": [ - { - "$ref": "#/definitions/WebviewUrl" + "description": "An external URL to load.", + "type": "object", + "required": [ + "url" + ], + "properties": { + "url": { + "type": "string", + "format": "uri" } - ] + }, + "additionalProperties": false + }, + { + "description": "Path to the folder containing the frontend dist assets.", + "type": "object", + "required": [ + "dist" + ], + "properties": { + "dist": { + "type": "string" + } + }, + "additionalProperties": false }, { "description": "An array of files to embed on the app.", - "type": "array", - "items": { - "type": "string" - } + "type": "object", + "required": [ + "files" + ], + "properties": { + "files": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false } ] }, diff --git a/core/tauri-utils/src/config.rs b/core/tauri-utils/src/config.rs index 1f7c5f54f2d7..f9b93582b87c 100644 --- a/core/tauri-utils/src/config.rs +++ b/core/tauri-utils/src/config.rs @@ -1710,19 +1710,22 @@ fn default_min_sdk_version() -> u32 { /// Defines the URL or assets to embed in the application. #[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "schema", derive(JsonSchema))] -#[serde(untagged, deny_unknown_fields)] +#[serde(deny_unknown_fields, rename_all = "camelCase")] #[non_exhaustive] -pub enum AppUrl { - /// The app's external URL, or the path to the directory containing the app assets. - Url(WebviewUrl), +pub enum ProdFrontend { + /// An external URL to load. + Url(Url), + /// Path to the folder containing the frontend dist assets. + Dist(PathBuf), /// An array of files to embed on the app. Files(Vec), } -impl std::fmt::Display for AppUrl { +impl std::fmt::Display for ProdFrontend { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::Url(url) => write!(f, "{url}"), + Self::Dist(p) => write!(f, "{}", p.display()), Self::Files(files) => write!(f, "{}", serde_json::to_string(files).unwrap()), } } @@ -1778,7 +1781,7 @@ pub struct BuildConfig { /// This is usually an URL to a dev server, which serves your application assets with hot-reload and HMR. /// Most modern JavaScript bundlers like [vite](https://vitejs.dev/guide/) provides a way to start a dev server by default. /// - /// If you don't have a dev server or don't want to use one, ignore this option and use [`frontendDist`](BuildConfig::frontend_dist) + /// If you don't have a dev server or don't want to use one, ignore this option and use [`prodFrontend`](BuildConfig::prod_frontend) /// and point to a web assets directory, and Tauri CLI will run its built-in dev server and provide a simple hot-reload experience. #[serde(alias = "dev-url")] pub dev_url: Option, @@ -1796,7 +1799,7 @@ pub struct BuildConfig { /// When a URL is provided, the application won't have bundled assets /// and the application will load that URL by default. #[serde(alias = "frontend-dist")] - pub frontend_dist: Option, + pub prod_frontend: Option, /// A shell command to run before `tauri dev` kicks in. /// /// The TAURI_ENV_PLATFORM, TAURI_ENV_ARCH, TAURI_ENV_FAMILY, TAURI_ENV_PLATFORM_VERSION, TAURI_ENV_PLATFORM_TYPE and TAURI_ENV_DEBUG environment variables are set if you perform conditional compilation. @@ -1922,7 +1925,9 @@ where /// "beforeBuildCommand": "", /// "beforeDevCommand": "", /// "devUrl": "../dist", -/// "frontendDist": "../dist" +/// "prodFrontend": { +/// "dist": "../dist" +/// }, /// }, /// "app": { /// "security": { @@ -2003,7 +2008,7 @@ fn default_build() -> BuildConfig { BuildConfig { runner: None, dev_url: None, - frontend_dist: None, + prod_frontend: None, before_dev_command: None, before_build_command: None, before_bundle_command: None, @@ -2335,14 +2340,19 @@ mod build { } } - impl ToTokens for AppUrl { + impl ToTokens for ProdFrontend { fn to_tokens(&self, tokens: &mut TokenStream) { - let prefix = quote! { ::tauri::utils::config::AppUrl }; + let prefix = quote! { ::tauri::utils::config::ProdFrontend }; tokens.append_all(match self { Self::Url(url) => { + let url = url_lit(url); quote! { #prefix::Url(#url) } } + Self::Dist(path) => { + let path = path_buf_lit(path); + quote! { #prefix::Dist(#path) } + } Self::Files(files) => { let files = vec_lit(files, path_buf_lit); quote! { #prefix::Files(#files) } @@ -2354,7 +2364,7 @@ mod build { impl ToTokens for BuildConfig { fn to_tokens(&self, tokens: &mut TokenStream) { let dev_url = opt_lit(self.dev_url.as_ref().map(url_lit).as_ref()); - let frontend_dist = opt_lit(self.frontend_dist.as_ref()); + let prod_frontend = opt_lit(self.prod_frontend.as_ref()); let runner = quote!(None); let before_dev_command = quote!(None); let before_build_command = quote!(None); @@ -2366,7 +2376,7 @@ mod build { ::tauri::utils::config::BuildConfig, runner, dev_url, - frontend_dist, + prod_frontend, before_dev_command, before_build_command, before_bundle_command, @@ -2614,7 +2624,7 @@ mod test { let build = BuildConfig { runner: None, dev_url: None, - frontend_dist: None, + prod_frontend: None, before_dev_command: None, before_build_command: None, before_bundle_command: None, diff --git a/core/tauri/src/manager/mod.rs b/core/tauri/src/manager/mod.rs index 620f52b36ed2..a43dc0e1c70a 100644 --- a/core/tauri/src/manager/mod.rs +++ b/core/tauri/src/manager/mod.rs @@ -292,11 +292,11 @@ impl AppManager { /// Get the base path to serve data from. /// /// * In dev mode, this will be based on the `devUrl` configuration value. - /// * Otherwise, this will be based on the `frontendDist` configuration value. + /// * Otherwise, this will be based on the `prodFrontend` configuration value. #[cfg(not(dev))] fn base_path(&self) -> Option<&Url> { use crate::{utils::config::AppUrl, WebviewUrl}; - match self.config.build.frontend_dist.as_ref() { + match self.config.build.prod_frontend.as_ref() { Some(AppUrl::Url(WebviewUrl::External(url) | WebviewUrl::CustomProtocol(url))) => Some(url), _ => None, } diff --git a/core/tauri/src/webview/mod.rs b/core/tauri/src/webview/mod.rs index 025ad6d4e8a5..c2fbae3b9e32 100644 --- a/core/tauri/src/webview/mod.rs +++ b/core/tauri/src/webview/mod.rs @@ -1030,7 +1030,7 @@ fn main() { && current_url.domain() == protocol_url.domain() }) || - // or if relative to `devUrl` or `frontendDist` + // or if relative to `devUrl` or `prodFrontend` self .manager() .get_url() diff --git a/core/tauri/test/fixture/src-tauri/tauri.conf.json b/core/tauri/test/fixture/src-tauri/tauri.conf.json index f2ae0a453308..e10dc97e8c01 100644 --- a/core/tauri/test/fixture/src-tauri/tauri.conf.json +++ b/core/tauri/test/fixture/src-tauri/tauri.conf.json @@ -2,7 +2,9 @@ "$schema": "../../../../../core/tauri-config-schema/schema.json", "identifier": "studio.tauri.example", "build": { - "frontendDist": "../dist", + "prodFrontend": { + "dist": "../dist" + }, "devUrl": "http://localhost:4000" }, "app": { @@ -18,4 +20,4 @@ "bundle": { "active": true } -} +} \ No newline at end of file diff --git a/examples/api/src-tauri/tauri.conf.json b/examples/api/src-tauri/tauri.conf.json index 99d66545f619..65cf5045be0d 100644 --- a/examples/api/src-tauri/tauri.conf.json +++ b/examples/api/src-tauri/tauri.conf.json @@ -4,7 +4,9 @@ "version": "1.0.0", "identifier": "com.tauri.api", "build": { - "frontendDist": "../dist", + "prodFrontend": { + "dist": "../dist" + }, "devUrl": "http://localhost:1420", "beforeDevCommand": "yarn dev", "beforeBuildCommand": "yarn build" @@ -22,7 +24,9 @@ "csp": { "default-src": "'self' customprotocol: asset:", "connect-src": "ipc: http://ipc.localhost", - "font-src": ["https://fonts.gstatic.com"], + "font-src": [ + "https://fonts.gstatic.com" + ], "img-src": "'self' asset: http://asset.localhost blob: data:", "style-src": "'unsafe-inline' 'self' https://fonts.googleapis.com" }, @@ -30,8 +34,13 @@ "assetProtocol": { "enable": true, "scope": { - "allow": ["$APPDATA/db/**", "$RESOURCE/**"], - "deny": ["$APPDATA/db/*.stronghold"] + "allow": [ + "$APPDATA/db/**", + "$RESOURCE/**" + ], + "deny": [ + "$APPDATA/db/*.stronghold" + ] } } } @@ -51,7 +60,11 @@ "name": "theme", "takesValue": true, "description": "App theme", - "possibleValues": ["light", "dark", "system"] + "possibleValues": [ + "light", + "dark", + "system" + ] }, { "short": "v", @@ -93,4 +106,4 @@ } } } -} +} \ No newline at end of file diff --git a/examples/commands/tauri.conf.json b/examples/commands/tauri.conf.json index cf9362c44b6e..f5e66f94cd37 100644 --- a/examples/commands/tauri.conf.json +++ b/examples/commands/tauri.conf.json @@ -4,7 +4,11 @@ "version": "0.1.0", "identifier": "com.tauri.dev", "build": { - "frontendDist": ["index.html"] + "prodFrontend": { + "files": [ + "index.html" + ] + } }, "app": { "withGlobalTauri": true, @@ -32,4 +36,4 @@ "../.icons/icon.ico" ] } -} +} \ No newline at end of file diff --git a/examples/file-associations/src-tauri/tauri.conf.json b/examples/file-associations/src-tauri/tauri.conf.json index 6252905d86aa..7667075167ae 100644 --- a/examples/file-associations/src-tauri/tauri.conf.json +++ b/examples/file-associations/src-tauri/tauri.conf.json @@ -2,7 +2,11 @@ "$schema": "../../../tooling/cli/schema.json", "identifier": "com.tauri.dev-file-associations-demo", "build": { - "frontendDist": ["../index.html"] + "prodFrontend": { + "files": [ + "../index.html" + ] + } }, "app": { "security": { @@ -21,17 +25,24 @@ ], "fileAssociations": [ { - "ext": ["png"], + "ext": [ + "png" + ], "mimeType": "image/png" }, { - "ext": ["jpg", "jpeg"], + "ext": [ + "jpg", + "jpeg" + ], "mimeType": "image/jpeg" }, { - "ext": ["gif"], + "ext": [ + "gif" + ], "mimeType": "image/gif" } ] } -} +} \ No newline at end of file diff --git a/examples/helloworld/tauri.conf.json b/examples/helloworld/tauri.conf.json index be12e4c7e3f8..e7039d4d067a 100644 --- a/examples/helloworld/tauri.conf.json +++ b/examples/helloworld/tauri.conf.json @@ -4,7 +4,11 @@ "version": "0.1.0", "identifier": "com.tauri.dev", "build": { - "frontendDist": ["index.html"] + "prodFrontend": { + "files": [ + "index.html" + ] + } }, "app": { "windows": [ @@ -31,4 +35,4 @@ "../.icons/icon.ico" ] } -} +} \ No newline at end of file diff --git a/examples/isolation/tauri.conf.json b/examples/isolation/tauri.conf.json index 030659c20899..db5b167f5e8c 100644 --- a/examples/isolation/tauri.conf.json +++ b/examples/isolation/tauri.conf.json @@ -4,7 +4,9 @@ "version": "0.1.0", "identifier": "com.tauri.dev", "build": { - "frontendDist": "dist", + "prodFrontend": { + "dist": "dist" + }, "beforeDevCommand": "", "beforeBuildCommand": "" }, @@ -40,4 +42,4 @@ "../.icons/icon.ico" ] } -} +} \ No newline at end of file diff --git a/examples/multiwebview/tauri.conf.json b/examples/multiwebview/tauri.conf.json index ff5553852f0b..3817c399ea89 100644 --- a/examples/multiwebview/tauri.conf.json +++ b/examples/multiwebview/tauri.conf.json @@ -4,7 +4,11 @@ "identifier": "com.tauri.dev", "$schema": "../../core/tauri-config-schema/schema.json", "build": { - "frontendDist": ["index.html"] + "prodFrontend": { + "files": [ + "index.html" + ] + } }, "app": { "security": { @@ -22,4 +26,4 @@ "../.icons/icon.ico" ] } -} +} \ No newline at end of file diff --git a/examples/multiwindow/tauri.conf.json b/examples/multiwindow/tauri.conf.json index d655a5b78397..9796ebed9c41 100644 --- a/examples/multiwindow/tauri.conf.json +++ b/examples/multiwindow/tauri.conf.json @@ -4,7 +4,11 @@ "version": "0.1.0", "identifier": "com.tauri.dev", "build": { - "frontendDist": ["index.html"] + "prodFrontend": { + "files": [ + "index.html" + ] + } }, "app": { "withGlobalTauri": true, @@ -43,4 +47,4 @@ "copyright": "", "category": "DeveloperTool" } -} +} \ No newline at end of file diff --git a/examples/navigation/tauri.conf.json b/examples/navigation/tauri.conf.json index 3aad5b94db00..3db9393ac175 100644 --- a/examples/navigation/tauri.conf.json +++ b/examples/navigation/tauri.conf.json @@ -4,7 +4,9 @@ "version": "0.1.0", "identifier": "com.tauri.dev", "build": { - "frontendDist": "public" + "prodFrontend": { + "dist": "public" + } }, "app": { "withGlobalTauri": true, @@ -32,4 +34,4 @@ "../.icons/icon.ico" ] } -} +} \ No newline at end of file diff --git a/examples/parent-window/tauri.conf.json b/examples/parent-window/tauri.conf.json index af06d286da14..5ce5a8b91070 100644 --- a/examples/parent-window/tauri.conf.json +++ b/examples/parent-window/tauri.conf.json @@ -4,11 +4,14 @@ "version": "0.1.0", "identifier": "com.tauri.dev", "build": { - "frontendDist": ["index.html"] + "prodFrontend": { + "files": [ + "index.html" + ] + } }, "app": { "withGlobalTauri": true, - "security": { "csp": "default-src 'self'; connect-src ipc: http://ipc.localhost" } @@ -24,4 +27,4 @@ "../.icons/icon.ico" ] } -} +} \ No newline at end of file diff --git a/examples/resources/src-tauri/tauri.conf.json b/examples/resources/src-tauri/tauri.conf.json index 8d4354949efb..f5fba47afe6f 100644 --- a/examples/resources/src-tauri/tauri.conf.json +++ b/examples/resources/src-tauri/tauri.conf.json @@ -4,11 +4,14 @@ "version": "0.1.0", "identifier": "com.tauri.resources", "build": { - "frontendDist": ["../index.html"] + "prodFrontend": { + "files": [ + "../index.html" + ] + } }, "app": { "withGlobalTauri": true, - "windows": [ { "title": "Welcome to Tauri!", @@ -32,6 +35,8 @@ "../../.icons/icon.icns", "../../.icons/icon.ico" ], - "resources": ["assets/*"] + "resources": [ + "assets/*" + ] } -} +} \ No newline at end of file diff --git a/examples/run-iteration/tauri.conf.json b/examples/run-iteration/tauri.conf.json index b65b042c0f53..fc2db482a7cc 100644 --- a/examples/run-iteration/tauri.conf.json +++ b/examples/run-iteration/tauri.conf.json @@ -4,7 +4,11 @@ "version": "0.1.0", "identifier": "com.tauri.dev", "build": { - "frontendDist": ["index.html"] + "prodFrontend": { + "files": [ + "index.html" + ] + } }, "app": { "windows": [ @@ -31,4 +35,4 @@ "../.icons/icon.ico" ] } -} +} \ No newline at end of file diff --git a/examples/splashscreen/tauri.conf.json b/examples/splashscreen/tauri.conf.json index 8af2e29e61d4..7577a51cbea5 100644 --- a/examples/splashscreen/tauri.conf.json +++ b/examples/splashscreen/tauri.conf.json @@ -4,7 +4,9 @@ "version": "0.1.0", "identifier": "com.tauri.dev", "build": { - "frontendDist": "dist" + "prodFrontend": { + "dist": "dist" + } }, "app": { "withGlobalTauri": true, @@ -40,4 +42,4 @@ "../.icons/icon.ico" ] } -} +} \ No newline at end of file diff --git a/examples/state/tauri.conf.json b/examples/state/tauri.conf.json index 4715043fc344..971d454309c8 100644 --- a/examples/state/tauri.conf.json +++ b/examples/state/tauri.conf.json @@ -4,7 +4,11 @@ "version": "0.1.0", "identifier": "com.tauri.dev", "build": { - "frontendDist": ["index.html"] + "prodFrontend": { + "files": [ + "index.html" + ] + } }, "app": { "withGlobalTauri": true, @@ -32,4 +36,4 @@ "../.icons/icon.ico" ] } -} +} \ No newline at end of file diff --git a/examples/streaming/tauri.conf.json b/examples/streaming/tauri.conf.json index e4023d9c902a..d749e0fb1ea2 100644 --- a/examples/streaming/tauri.conf.json +++ b/examples/streaming/tauri.conf.json @@ -4,7 +4,11 @@ "version": "0.1.0", "identifier": "com.tauri.dev", "build": { - "frontendDist": ["index.html"] + "prodFrontend": { + "files": [ + "index.html" + ] + } }, "app": { "withGlobalTauri": true, @@ -20,7 +24,9 @@ "security": { "csp": "default-src 'self'; connect-src ipc: http://ipc.localhost; media-src stream: http://stream.localhost asset: http://asset.localhost", "assetProtocol": { - "scope": ["**/test_video.mp4"] + "scope": [ + "**/test_video.mp4" + ] } } }, @@ -35,4 +41,4 @@ "../.icons/icon.ico" ] } -} +} \ No newline at end of file diff --git a/examples/web/core/tauri/tauri.conf.json b/examples/web/core/tauri/tauri.conf.json index 8f2e81aaaafa..44c1765ef119 100644 --- a/examples/web/core/tauri/tauri.conf.json +++ b/examples/web/core/tauri/tauri.conf.json @@ -7,7 +7,9 @@ "beforeBuildCommand": "yarn build:tauri", "beforeDevCommand": "yarn dev:tauri", "devUrl": "http://localhost:5173", - "frontendDist": "../../build" + "prodFrontend": { + "dist": "../../build" + } }, "app": { "security": { @@ -34,4 +36,4 @@ "../../../.icons/icon.ico" ] } -} +} \ No newline at end of file diff --git a/examples/workspace/src-tauri/tauri.conf.json b/examples/workspace/src-tauri/tauri.conf.json index 583f77162619..cf64fb36c59f 100644 --- a/examples/workspace/src-tauri/tauri.conf.json +++ b/examples/workspace/src-tauri/tauri.conf.json @@ -4,7 +4,11 @@ "version": "0.1.0", "identifier": "com.tauri.workspace", "build": { - "frontendDist": ["../index.html"] + "prodFrontend": { + "files": [ + "../index.html" + ] + } }, "app": { "security": { @@ -31,4 +35,4 @@ "../../.icons/icon.ico" ] } -} +} \ No newline at end of file diff --git a/tooling/bench/tests/cpu_intensive/src-tauri/tauri.conf.json b/tooling/bench/tests/cpu_intensive/src-tauri/tauri.conf.json index 681d42f6f5b0..ed33b5541fff 100644 --- a/tooling/bench/tests/cpu_intensive/src-tauri/tauri.conf.json +++ b/tooling/bench/tests/cpu_intensive/src-tauri/tauri.conf.json @@ -2,7 +2,9 @@ "$schema": "../../../../../core/tauri-config-schema/schema.json", "identifier": "com.tauri.dev", "build": { - "frontendDist": "../public" + "prodFrontend": { + "dist": "../public" + }, }, "app": { "withGlobalTauri": true, @@ -30,4 +32,4 @@ "../../../../../examples/.icons/icon.ico" ] } -} +} \ No newline at end of file diff --git a/tooling/bench/tests/files_transfer/src-tauri/tauri.conf.json b/tooling/bench/tests/files_transfer/src-tauri/tauri.conf.json index 681d42f6f5b0..ed33b5541fff 100644 --- a/tooling/bench/tests/files_transfer/src-tauri/tauri.conf.json +++ b/tooling/bench/tests/files_transfer/src-tauri/tauri.conf.json @@ -2,7 +2,9 @@ "$schema": "../../../../../core/tauri-config-schema/schema.json", "identifier": "com.tauri.dev", "build": { - "frontendDist": "../public" + "prodFrontend": { + "dist": "../public" + }, }, "app": { "withGlobalTauri": true, @@ -30,4 +32,4 @@ "../../../../../examples/.icons/icon.ico" ] } -} +} \ No newline at end of file diff --git a/tooling/bench/tests/helloworld/src-tauri/tauri.conf.json b/tooling/bench/tests/helloworld/src-tauri/tauri.conf.json index e9e9f150dd63..f5d6f3e598c1 100644 --- a/tooling/bench/tests/helloworld/src-tauri/tauri.conf.json +++ b/tooling/bench/tests/helloworld/src-tauri/tauri.conf.json @@ -2,7 +2,9 @@ "$schema": "../../../../../core/tauri-config-schema/schema.json", "identifier": "com.tauri.dev", "build": { - "frontendDist": "../public", + "prodFrontend": { + "dist": "../public" + }, "beforeDevCommand": "", "beforeBuildCommand": "" }, @@ -32,4 +34,4 @@ "../../../../../examples/.icons/icon.ico" ] } -} +} \ No newline at end of file diff --git a/tooling/cli/node/test/jest/fixtures/app/src-tauri/tauri.conf.json b/tooling/cli/node/test/jest/fixtures/app/src-tauri/tauri.conf.json index e424ea067bf3..50fd923e578c 100644 --- a/tooling/cli/node/test/jest/fixtures/app/src-tauri/tauri.conf.json +++ b/tooling/cli/node/test/jest/fixtures/app/src-tauri/tauri.conf.json @@ -2,7 +2,9 @@ "$schema": "../../../../../../../../core/tauri-config-schema/schema.json", "identifier": "fixture.app", "build": { - "frontendDist": "../dist" + "prodFrontend": { + "dist": "../dist" + }, }, "app": { "withGlobalTauri": true, @@ -22,4 +24,4 @@ "icons/icon.ico" ] } -} +} \ No newline at end of file diff --git a/tooling/cli/schema.json b/tooling/cli/schema.json index 682f29abd410..b50805a7dc09 100644 --- a/tooling/cli/schema.json +++ b/tooling/cli/schema.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Config", - "description": "The Tauri configuration object. It is read from a file where you can define your frontend assets, configure the bundler and define a tray icon.\n\nThe configuration file is generated by the [`tauri init`](https://tauri.app/v1/api/cli#init) command that lives in your Tauri application source directory (src-tauri).\n\nOnce generated, you may modify it at will to customize your Tauri application.\n\n## File Formats\n\nBy default, the configuration is defined as a JSON file named `tauri.conf.json`.\n\nTauri also supports JSON5 and TOML files via the `config-json5` and `config-toml` Cargo features, respectively. The JSON5 file name must be either `tauri.conf.json` or `tauri.conf.json5`. The TOML file name is `Tauri.toml`.\n\n## Platform-Specific Configuration\n\nIn addition to the default configuration file, Tauri can read a platform-specific configuration from `tauri.linux.conf.json`, `tauri.windows.conf.json`, `tauri.macos.conf.json`, `tauri.android.conf.json` and `tauri.ios.conf.json` (or `Tauri.linux.toml`, `Tauri.windows.toml`, `Tauri.macos.toml`, `Tauri.android.toml` and `Tauri.ios.toml` if the `Tauri.toml` format is used), which gets merged with the main configuration object.\n\n## Configuration Structure\n\nThe configuration is composed of the following objects:\n\n- [`package`](#packageconfig): Package settings - [`app`](#appconfig): The Tauri config - [`build`](#buildconfig): The build configuration - [`plugins`](#pluginconfig): The plugins config\n\n```json title=\"Example tauri.config.json file\" { \"productName\": \"tauri-app\", \"version\": \"0.1.0\" \"build\": { \"beforeBuildCommand\": \"\", \"beforeDevCommand\": \"\", \"devUrl\": \"../dist\", \"frontendDist\": \"../dist\" }, \"app\": { \"security\": { \"csp\": null }, \"windows\": [ { \"fullscreen\": false, \"height\": 600, \"resizable\": true, \"title\": \"Tauri App\", \"width\": 800 } ] }, \"bundle\": {} } ```", + "description": "The Tauri configuration object. It is read from a file where you can define your frontend assets, configure the bundler and define a tray icon.\n\nThe configuration file is generated by the [`tauri init`](https://tauri.app/v1/api/cli#init) command that lives in your Tauri application source directory (src-tauri).\n\nOnce generated, you may modify it at will to customize your Tauri application.\n\n## File Formats\n\nBy default, the configuration is defined as a JSON file named `tauri.conf.json`.\n\nTauri also supports JSON5 and TOML files via the `config-json5` and `config-toml` Cargo features, respectively. The JSON5 file name must be either `tauri.conf.json` or `tauri.conf.json5`. The TOML file name is `Tauri.toml`.\n\n## Platform-Specific Configuration\n\nIn addition to the default configuration file, Tauri can read a platform-specific configuration from `tauri.linux.conf.json`, `tauri.windows.conf.json`, `tauri.macos.conf.json`, `tauri.android.conf.json` and `tauri.ios.conf.json` (or `Tauri.linux.toml`, `Tauri.windows.toml`, `Tauri.macos.toml`, `Tauri.android.toml` and `Tauri.ios.toml` if the `Tauri.toml` format is used), which gets merged with the main configuration object.\n\n## Configuration Structure\n\nThe configuration is composed of the following objects:\n\n- [`package`](#packageconfig): Package settings - [`app`](#appconfig): The Tauri config - [`build`](#buildconfig): The build configuration - [`plugins`](#pluginconfig): The plugins config\n\n```json title=\"Example tauri.config.json file\" { \"productName\": \"tauri-app\", \"version\": \"0.1.0\" \"build\": { \"beforeBuildCommand\": \"\", \"beforeDevCommand\": \"\", \"devUrl\": \"../dist\", \"prodFrontend\": { \"dist\": \"../dist\" }, }, \"app\": { \"security\": { \"csp\": null }, \"windows\": [ { \"fullscreen\": false, \"height\": 600, \"resizable\": true, \"title\": \"Tauri App\", \"width\": 800 } ] }, \"bundle\": {} } ```", "type": "object", "properties": { "$schema": { @@ -1097,18 +1097,18 @@ ] }, "devUrl": { - "description": "The URL to load in development.\n\nThis is usually an URL to a dev server, which serves your application assets with hot-reload and HMR. Most modern JavaScript bundlers like [vite](https://vitejs.dev/guide/) provides a way to start a dev server by default.\n\nIf you don't have a dev server or don't want to use one, ignore this option and use [`frontendDist`](BuildConfig::frontend_dist) and point to a web assets directory, and Tauri CLI will run its built-in dev server and provide a simple hot-reload experience.", + "description": "The URL to load in development.\n\nThis is usually an URL to a dev server, which serves your application assets with hot-reload and HMR. Most modern JavaScript bundlers like [vite](https://vitejs.dev/guide/) provides a way to start a dev server by default.\n\nIf you don't have a dev server or don't want to use one, ignore this option and use [`prodFrontend`](BuildConfig::prod_frontend) and point to a web assets directory, and Tauri CLI will run its built-in dev server and provide a simple hot-reload experience.", "type": [ "string", "null" ], "format": "uri" }, - "frontendDist": { + "prodFrontend": { "description": "The path to the application assets (usually the `dist` folder of your javascript bundler) or a URL that could be either a custom protocol registered in the tauri app (for example: `myprotocol://`) or a remote URL (for example: `https://site.com/app`).\n\nWhen a path relative to the configuration file is provided, it is read recursively and all files are embedded in the application binary. Tauri then looks for an `index.html` and serves it as the default entry point for your application.\n\nYou can also provide a list of paths to be embedded, which allows granular control over what files are added to the binary. In this case, all files are added to the root and you must reference it that way in your HTML files.\n\nWhen a URL is provided, the application won't have bundled assets and the application will load that URL by default.", "anyOf": [ { - "$ref": "#/definitions/AppUrl" + "$ref": "#/definitions/ProdFrontend" }, { "type": "null" @@ -1161,23 +1161,51 @@ }, "additionalProperties": false }, - "AppUrl": { + "ProdFrontend": { "description": "Defines the URL or assets to embed in the application.", - "anyOf": [ + "oneOf": [ { - "description": "The app's external URL, or the path to the directory containing the app assets.", - "allOf": [ - { - "$ref": "#/definitions/WebviewUrl" + "description": "An external URL to load.", + "type": "object", + "required": [ + "url" + ], + "properties": { + "url": { + "type": "string", + "format": "uri" } - ] + }, + "additionalProperties": false + }, + { + "description": "Path to the folder containing the frontend dist assets.", + "type": "object", + "required": [ + "dist" + ], + "properties": { + "dist": { + "type": "string" + } + }, + "additionalProperties": false }, { "description": "An array of files to embed on the app.", - "type": "array", - "items": { - "type": "string" - } + "type": "object", + "required": [ + "files" + ], + "properties": { + "files": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false } ] }, diff --git a/tooling/cli/src/build.rs b/tooling/cli/src/build.rs index 9b4b1592d8fe..56e49541d4b1 100644 --- a/tooling/cli/src/build.rs +++ b/tooling/cli/src/build.rs @@ -6,7 +6,7 @@ use crate::{ helpers::{ app_paths::{app_dir, tauri_dir}, command_env, - config::{get as get_config, AppUrl, HookCommand, WebviewUrl, MERGE_CONFIG_EXTENSION_NAME}, + config::{get as get_config, HookCommand, ProdFrontend, MERGE_CONFIG_EXTENSION_NAME}, resolve_merge_config, updater_signature::{secret_key as updater_secret_key, sign_file}, }, @@ -29,7 +29,7 @@ use tauri_utils::platform::Target; #[derive(Debug, Clone, Parser)] #[clap( about = "Build your app in release mode and generate bundles and installers", - long_about = "Build your app in release mode and generate bundles and installers. It makes use of the `build.frontendDist` property from your `tauri.conf.json` file. It also runs your `build.beforeBuildCommand` which usually builds your frontend into `build.frontendDist`. This will also run `build.beforeBundleCommand` before generating the bundles and installers of your app." + long_about = "Build your app in release mode and generate bundles and installers. It makes use of the `build.prodFrontend` property from your `tauri.conf.json` file. It also runs your `build.beforeBuildCommand` which usually builds your frontend into `build.prodFrontend`. This will also run `build.beforeBundleCommand` before generating the bundles and installers of your app." )] pub struct Options { /// Binary to use to build the application, defaults to `cargo` @@ -307,16 +307,16 @@ pub fn setup(target: Target, options: &mut Options, mobile: bool) -> Result build > frontendDist`.", + "The configured prodFrontend is the `src-tauri` folder. Please isolate your web assets on a separate folder and update `tauri.conf.json > build > prodFrontend`.", )); } @@ -328,7 +328,7 @@ pub fn setup(target: Target, options: &mut Options, mobile: bool) -> Result build > frontendDist`.", + "The configured prodFrontend includes the `{:?}` {}. Please isolate your web assets on a separate folder and update `tauri.conf.json > build > prodFrontend`.", out_folders, if out_folders.len() == 1 { "folder" }else { "folders" } ) diff --git a/tooling/cli/src/dev.rs b/tooling/cli/src/dev.rs index ff4518b6fe51..0512f534e659 100644 --- a/tooling/cli/src/dev.rs +++ b/tooling/cli/src/dev.rs @@ -6,7 +6,7 @@ use crate::{ helpers::{ app_paths::{app_dir, tauri_dir}, command_env, - config::{get as get_config, reload as reload_config, AppUrl, BeforeDevCommand, WebviewUrl}, + config::{get as get_config, reload as reload_config, BeforeDevCommand, ProdFrontend}, resolve_merge_config, }, interface::{AppInterface, DevProcess, ExitReason, Interface}, @@ -313,16 +313,16 @@ pub fn setup(target: Target, options: &mut Options, mobile: bool) -> Result String { + pub fn prod_frontend(&self) -> String { match self { Self::SolidJS => "../dist", Self::SolidStart => "../dist/public", diff --git a/tooling/cli/src/info/app.rs b/tooling/cli/src/info/app.rs index 3e2d07c2e0bf..4625b250e9ed 100644 --- a/tooling/cli/src/info/app.rs +++ b/tooling/cli/src/info/app.rs @@ -33,8 +33,8 @@ pub fn items(app_dir: Option<&PathBuf>, tauri_dir: Option<&Path>) -> Vec
, /// Web assets location, relative to /src-tauri #[clap(short = 'D', long)] - frontend_dist: Option, + prod_frontend: Option, /// Url of your dev server #[clap(short = 'P', long)] dev_url: Option, @@ -109,9 +109,9 @@ impl Options { ) })?; - self.frontend_dist = self.frontend_dist.map(|s| Ok(Some(s))).unwrap_or_else(|| request_input( + self.prod_frontend = self.prod_frontend.map(|s| Ok(Some(s))).unwrap_or_else(|| request_input( r#"Where are your web assets (HTML/CSS/JS) located, relative to the "/src-tauri/tauri.conf.json" file that will be created?"#, - init_defaults.framework.as_ref().map(|f| f.frontend_dist()), + init_defaults.framework.as_ref().map(|f| f.prod_frontend()), self.ci, false, ))?; @@ -190,10 +190,10 @@ pub fn command(mut options: Options) -> Result<()> { data.insert("tauri_dep", to_json(tauri_dep)); data.insert("tauri_build_dep", to_json(tauri_build_dep)); data.insert( - "frontend_dist", + "prod_frontend", to_json( options - .frontend_dist + .prod_frontend .unwrap_or_else(|| "../dist".to_string()), ), ); diff --git a/tooling/cli/src/migrate/config.rs b/tooling/cli/src/migrate/config.rs index 67d840e53302..83d59ba547f2 100644 --- a/tooling/cli/src/migrate/config.rs +++ b/tooling/cli/src/migrate/config.rs @@ -174,7 +174,23 @@ fn process_package_metadata(config: &mut Map) { fn process_build(config: &mut Map) { if let Some(build_config) = config.get_mut("build").and_then(|b| b.as_object_mut()) { if let Some(dist_dir) = build_config.remove("distDir") { - build_config.insert("frontendDist".into(), dist_dir); + match &dist_dir { + Value::Array(_files) => { + let mut frontend = Map::new(); + frontend.insert("files".to_string(), dist_dir); + build_config.insert("prodFrontend".into(), frontend.into()); + } + Value::String(url_or_path) => { + let mut frontend = Map::new(); + if url::Url::parse(url_or_path).is_ok() { + frontend.insert("url".to_string(), dist_dir); + } else { + frontend.insert("dist".to_string(), dist_dir); + } + build_config.insert("prodFrontend".into(), frontend.into()); + } + _ => (), + } } if let Some(dist_dir) = build_config.remove("devPath") { build_config.insert("devUrl".into(), dist_dir); @@ -701,7 +717,7 @@ mod test { // build object assert_eq!( - migrated["build"]["frontendDist"], + migrated["build"]["prodFrontend"]["dist"], original["build"]["distDir"] ); assert_eq!(migrated["build"]["devUrl"], original["build"]["devPath"]); diff --git a/tooling/cli/src/mobile/android/build.rs b/tooling/cli/src/mobile/android/build.rs index 4558f51c171c..a9a3a392af78 100644 --- a/tooling/cli/src/mobile/android/build.rs +++ b/tooling/cli/src/mobile/android/build.rs @@ -31,7 +31,7 @@ use std::env::{set_current_dir, set_var}; #[derive(Debug, Clone, Parser)] #[clap( about = "Build your app in release mode for Android and generate APKs and AABs", - long_about = "Build your app in release mode for Android and generate APKs and AABs. It makes use of the `build.frontendDist` property from your `tauri.conf.json` file. It also runs your `build.beforeBuildCommand` which usually builds your frontend into `build.frontendDist`." + long_about = "Build your app in release mode for Android and generate APKs and AABs. It makes use of the `build.prodFrontend` property from your `tauri.conf.json` file. It also runs your `build.beforeBuildCommand` which usually builds your frontend into `build.prodFrontend`." )] pub struct Options { /// Builds with the debug flag diff --git a/tooling/cli/src/mobile/ios/build.rs b/tooling/cli/src/mobile/ios/build.rs index 04720aa4d56e..31a50e17ab1d 100644 --- a/tooling/cli/src/mobile/ios/build.rs +++ b/tooling/cli/src/mobile/ios/build.rs @@ -32,7 +32,7 @@ use std::{env::set_current_dir, fs}; #[derive(Debug, Clone, Parser)] #[clap( about = "Build your app in release mode for iOS and generate IPAs", - long_about = "Build your app in release mode for iOS and generate IPAs. It makes use of the `build.frontendDist` property from your `tauri.conf.json` file. It also runs your `build.beforeBuildCommand` which usually builds your frontend into `build.frontendDist`." + long_about = "Build your app in release mode for iOS and generate IPAs. It makes use of the `build.prodFrontend` property from your `tauri.conf.json` file. It also runs your `build.beforeBuildCommand` which usually builds your frontend into `build.prodFrontend`." )] pub struct Options { /// Builds with the debug flag diff --git a/tooling/cli/templates/plugin/__example-api/tauri-app/src-tauri/tauri.conf.json b/tooling/cli/templates/plugin/__example-api/tauri-app/src-tauri/tauri.conf.json index a11326d4935a..81a25d2624df 100644 --- a/tooling/cli/templates/plugin/__example-api/tauri-app/src-tauri/tauri.conf.json +++ b/tooling/cli/templates/plugin/__example-api/tauri-app/src-tauri/tauri.conf.json @@ -6,7 +6,9 @@ "beforeDevCommand": "yarn dev", "beforeBuildCommand": "yarn build", "devUrl": "http://localhost:1420", - "frontendDist": "../dist" + "prodFrontend": { + "dist": "../dist" + }, }, "app": { "withGlobalTauri": false, @@ -34,4 +36,4 @@ "icons/icon.ico" ] } -} +} \ No newline at end of file diff --git a/tooling/cli/templates/plugin/__example-basic/vanilla/src-tauri/tauri.conf.json b/tooling/cli/templates/plugin/__example-basic/vanilla/src-tauri/tauri.conf.json index 6e8341e8b78f..04251ae0fd0b 100644 --- a/tooling/cli/templates/plugin/__example-basic/vanilla/src-tauri/tauri.conf.json +++ b/tooling/cli/templates/plugin/__example-basic/vanilla/src-tauri/tauri.conf.json @@ -3,7 +3,9 @@ "version": "0.1.0", "identifier": "com.tauri.{{ plugin_name }}", "build": { - "frontendDist": "../public" + "prodFrontend": { + "dist": "../public" + }, }, "app": { "windows": [ @@ -30,4 +32,4 @@ "icons/icon.ico" ] } -} +} \ No newline at end of file diff --git a/tooling/cli/templates/tauri.conf.json b/tooling/cli/templates/tauri.conf.json index 66155a36330d..5835e5f5ca52 100644 --- a/tooling/cli/templates/tauri.conf.json +++ b/tooling/cli/templates/tauri.conf.json @@ -3,7 +3,9 @@ "version": "0.1.0", "identifier": "com.tauri.dev", "build": { - "frontendDist": "{{ frontend_dist }}", + "prodFrontend": { + "dist": "{{ prod_frontend }}" + }, "devUrl": "{{ dev_url }}", "beforeDevCommand": "{{ before_dev_command }}", "beforeBuildCommand": "{{ before_build_command }}" @@ -33,4 +35,4 @@ "icons/icon.ico" ] } -} +} \ No newline at end of file