generator-esri-appbuilder-js
generator-esri-appbuilder-js copied to clipboard
widget config.json does not grunt
current WAB dev edition saves a widgets config.json file in:
\server\apps#\configs\WidgetName\config_widgetname.json
so grunt will not update the config.json file in directory:
\server\apps#\widgets\WidgetName
You must copy the config_WidgetName.json then use it to replace the config.json in the widget development folder. then remember to update the app's "main" config.json to point to the correct location of the config_widgetname.json file:
{
"position": {
"right": 110,
"top": 10,
"relativeTo": "map"
},
"placeholderIndex": 1,
"id": "_12",
"name": "WidgetName",
"version": "0.0.0",
"IsController": false,
"uri": "widgets/WidgetName/Widget",
"config": "widgets/WidgetName/config_widgetname.json",
"icon": "widgets/WidgetName/images/icon_widgetname.png"
}
@tyler-austin thank you for posting this issue.
Maybe we should solve this by having the grunt task automatically copy widgets/MyWidget/config.json to apps/Z/configs/MyWidget/config_MyWidget.json when it detects changes. Would that solve the problem here?
That would probably be the best approach. I should add that I experienced this when using the generator for 2D apps and widgets. I have yet to try 3D maps and widgets so I don't know if the behavior has has changed for both.
Any reason why this was dropped from the milestone. Just tried the generator at WAB 2.8 and I am seeing the same thing.
I think I'm late, but add some lines to the Gruntfile.js file, specifically inside the copy key
sample: { src: 'widgets/widgetname/config.json', dest: appDir + '/configs/widgetname/config_widgets_widgetname_Widget_id.json'}
If you have a better solution please let me know. 👍