@@ -214,6 +214,21 @@ fn create_app(config: Config) -> App {
214214
215215 app. insert_resource ( config. clone ( ) ) ;
216216
217+ if let Some ( asset_path) = config. get ( ConfigKey :: AssetRootPath ) {
218+ app. register_asset_source (
219+ "assets_directory" ,
220+ AssetSourceBuilder :: platform_default ( asset_path, None ) ,
221+ ) ;
222+ }
223+
224+ if let Some ( sketch_path) = config. get ( ConfigKey :: SketchRootPath ) {
225+ println ! ( "DEBUG SKETCH PATH = {sketch_path}" ) ;
226+ app. register_asset_source (
227+ "sketch_directory" ,
228+ AssetSourceBuilder :: platform_default ( sketch_path, None ) ,
229+ ) ;
230+ }
231+
217232 #[ cfg( not( target_arch = "wasm32" ) ) ]
218233 let plugins = DefaultPlugins
219234 . build ( )
@@ -236,21 +251,11 @@ fn create_app(config: Config) -> App {
236251 ..default ( )
237252 } ) ;
238253
239- if let Some ( asset_path) = config. get ( ConfigKey :: AssetRootPath ) {
240- app. register_asset_source (
241- "assets_directory" ,
242- AssetSourceBuilder :: platform_default ( asset_path, None ) ,
243- ) ;
244- }
245-
246254 app. add_plugins ( plugins) ;
247- if let Some ( sketch_path) = config. get ( ConfigKey :: SketchRootPath ) {
248- println ! ( "DEBUG SKETCH PATH = {sketch_path}" ) ;
249- app. register_asset_source (
250- "sketch_directory" ,
251- AssetSourceBuilder :: platform_default ( sketch_path, None ) ,
252- )
253- . add_plugins ( sketch:: LivecodePlugin ) ;
255+
256+ if let Some ( _) = config. get ( ConfigKey :: SketchRootPath ) {
257+ info ! ( "Adding plugin" ) ;
258+ app. add_plugins ( sketch:: LivecodePlugin ) ;
254259 }
255260
256261 app. add_plugins ( (
0 commit comments