grunt and copies of widget config.json

461
2
08-31-2018 10:47 AM
ChetEgbert1
New Contributor II

I happened upon a good video here "Web AppBuilder for ArcGIS Advanced Development Tools and Techniques - YouTube " and managed to get Yeoman and grunt working to streamline my development workflow.  One issue I find is that my custom widget config.json winds up in two places under server/apps/n.  It is in the server/apps/n/widgets/x (with a name like config.json) and it is at server/apps/n/configs/x (with the name like config_widgets_x_Widget_n.js).

The trouble is that grunt copies from my repo only to server/apps/n/widgets/x.  So multiple copies of the custom widget config get out of sync. Referencing the config in javascript don't work while referencing in html by ${} will. 

I found my custom widget x listed in server/apps/n/config.json and changed its config property from the path server/apps/n/configs/x to the path server/apps/n/widgets/x.  Now all seams to work. I even renamed the duplicate config_widgets_x_Widget_n.js in server/apps/n/configs/x to xconfig_widgets_x_Widget_n.js to see if the app would miss it but it don't.

Why is a duplicate custom widget config kept in server/apps/n/configs/x?  Will the change i made to server/apps/n/config.json cause any unintended consequence?

2 Replies
RobertScheitlin__GISP
MVP Emeritus

Chet,

   When a widget is added to an app the config.json from the widget folder is used as a template and copied to the apps configs folder. Having all the widgets configs in one location is a benefit when it comes to maintain the app in the future (it is easy to find all the widgets configs in one folder instead of hunting them in individual widget folder). You changing the apps main config.json to re-point to the widgets config.json is not an issue though.

ChetEgbert1
New Contributor II

I can see how having all the configs in one place would be helpful.  I need to edit my Gruntfile.js to copy changes as I make them to the apps configs folder.  Thanks.

0 Kudos