@@ -26,8 +26,18 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
2626 } = data;
2727
2828 let mut options = AssetOptions :: new ( ) ;
29- if let Some ( csp) = & config. tauri . security . csp {
30- options = options. csp ( csp. clone ( ) ) ;
29+ let csp = if dev {
30+ config
31+ . tauri
32+ . security
33+ . dev_csp
34+ . clone ( )
35+ . or_else ( || config. tauri . security . csp . clone ( ) )
36+ } else {
37+ config. tauri . security . csp . clone ( )
38+ } ;
39+ if csp. is_some ( ) {
40+ options = options. with_csp ( ) ;
3141 }
3242
3343 let app_url = if dev {
@@ -54,12 +64,15 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
5464 path
5565 )
5666 }
57- EmbeddedAssets :: new ( & assets_path, options) ?
67+ EmbeddedAssets :: new ( assets_path, options) ?
5868 }
5969 _ => unimplemented ! ( ) ,
6070 } ,
61- AppUrl :: Files ( files) => EmbeddedAssets :: load_paths (
62- files. iter ( ) . map ( |p| config_parent. join ( p) ) . collect ( ) ,
71+ AppUrl :: Files ( files) => EmbeddedAssets :: new (
72+ files
73+ . iter ( )
74+ . map ( |p| config_parent. join ( p) )
75+ . collect :: < Vec < _ > > ( ) ,
6376 options,
6477 ) ?,
6578 _ => unimplemented ! ( ) ,
@@ -121,9 +134,11 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
121134 Some (
122135 #root:: Icon :: File (
123136 #root:: api:: path:: resolve_path(
124- & #config, & #package_info,
125- #system_tray_icon_file_path,
126- Some ( #root:: api:: path:: BaseDirectory :: Resource )
137+ & #config,
138+ & #package_info,
139+ & Default :: default ( ) ,
140+ #system_tray_icon_file_path,
141+ Some ( #root:: api:: path:: BaseDirectory :: Resource )
127142 ) . expect( "failed to resolve resource dir" )
128143 )
129144 )
0 commit comments