I need to use the js library at https://pegjs.org/.
I have included a script tage in my custom code area to include it into the project.
But I cannot use this code when doing JS inside the editor.
Is there any way that I can make it so that I can use this code inside the WeWeb IDE when writing JS?
I had a similar problem but with custom css.
From the docs it seems that for now you can load custom code at page level only in the published version.
There are a couple of dirty workarounds for loading the scripts in the editor using the global
wwLib.wwUtils.addScriptToHead). Warning: this is not official and may break, also, unlike the published version, your library now will not be there until the script loads and is parsed (it should be ready when the returned promise is fulfilled).
A safer option could be to create a custom plugin. In this way you can bundle the library with the plugin and expose actions and formulas to use in the editor in a clean way. GitHub - weweb-assets/plugin-dayjs can be useful.
In my case I opted for the plugin also to test how it is the dev experience. I am planning to release the code soon.
Hope this can help
I had nothing else to add