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