Hi,
I have a custom widget written in JS API 4.x and I followed the https://github.com/Esri/arcgis-experience-builder-sdk-resources/tree/master/samples/js-api-widget to wrap the widget inside an ExB widget.
Let's assume the custom JS API widget is called Template and the build/transpiled files structure is:
- \Template.js
- \Template\TemplateViewModel.js
- \Template\nls\Template.js
- \Template\css\Template.css
Then I followed these steps to add the widget into the ExB:
- added the custom widget's transpiled files into the ExB widget's lib folder (your-extensions\widgets\my-custom-widget\src\runtime\lib)
- imported the custom widget inside the ExB widget class (import Template from "./lib/Template")
- create the widget instance as showcased in the sample mentioned above
Then, in runtime of the ExB application, loading the widget fails on systemjs.js fetching nls/localization files of the custom JS API widget.
As my custom JS API 4.x widget imports its localization files using dojo/i18n!./Template/nls/Template, this does not work while wrapping the widget inside an ExB widget.
What is the best practice to wrap custom JS API widgets inside an ExB widgets?
Thanks,
Matej