@@ -216,6 +216,21 @@ fn create_app(config: Config) -> App {
216216
217217 app. insert_resource ( config. clone ( ) ) ;
218218
219+ if let Some ( asset_path) = config. get ( ConfigKey :: AssetRootPath ) {
220+ app. register_asset_source (
221+ "assets_directory" ,
222+ AssetSourceBuilder :: platform_default ( asset_path, None ) ,
223+ ) ;
224+ }
225+
226+ if let Some ( sketch_path) = config. get ( ConfigKey :: SketchRootPath ) {
227+ println ! ( "DEBUG SKETCH PATH = {sketch_path}" ) ;
228+ app. register_asset_source (
229+ "sketch_directory" ,
230+ AssetSourceBuilder :: platform_default ( sketch_path, None ) ,
231+ ) ;
232+ }
233+
219234 #[ cfg( not( target_arch = "wasm32" ) ) ]
220235 let plugins = DefaultPlugins
221236 . build ( )
@@ -238,21 +253,11 @@ fn create_app(config: Config) -> App {
238253 ..default ( )
239254 } ) ;
240255
241- if let Some ( asset_path) = config. get ( ConfigKey :: AssetRootPath ) {
242- app. register_asset_source (
243- "assets_directory" ,
244- AssetSourceBuilder :: platform_default ( asset_path, None ) ,
245- ) ;
246- }
247-
248256 app. add_plugins ( plugins) ;
249- if let Some ( sketch_path) = config. get ( ConfigKey :: SketchRootPath ) {
250- println ! ( "DEBUG SKETCH PATH = {sketch_path}" ) ;
251- app. register_asset_source (
252- "sketch_directory" ,
253- AssetSourceBuilder :: platform_default ( sketch_path, None ) ,
254- )
255- . add_plugins ( sketch:: LivecodePlugin ) ;
257+
258+ if let Some ( _) = config. get ( ConfigKey :: SketchRootPath ) {
259+ info ! ( "Adding plugin" ) ;
260+ app. add_plugins ( sketch:: LivecodePlugin ) ;
256261 }
257262
258263 app. add_plugins ( (
0 commit comments