I have a custom widget I’d like to integrate into NetlifyCMS, however I am not using a build process that imports the CMS and compiles it to my site.
Does this mean I need to clone the NetlifyCMS repo and rebuild it to integrate my own custom widget?
The custom widget I want to use is already prebundled (I used the netlify widget starter) so writing it all again inline in the html isn’t really ideal for me…
I supposed I just want to be clear, is the only way to integrate bundled custom widgets to the CMS is to rebuild it manually?
Thank you @erez, the code in the parent widget repo was actually very helpful.
I was confused on how to name and export the widget because the netlify starter boilerplate recommends exporting it like this:
if (typeof window !== 'undefined') {
window.AwesomeControl = Control
window.AwesomePreview = Preview
}
export { Control as AwesomeControl, Preview as AwesomePreview }
…but the example you linked to uses this naming convention which worked for me :
I’m glad that repo made it easier @jaclyntan.
As for registering the widget on the window object - I don’t think there is a big difference, it is mostly a convenience.