docson
docson copied to clipboard
Multiple widgets in a html page doesn't work
<script src="/js/widget.js"
data-schema="schema1.json">
</script>
<script src="/js/widget.js"
data-schema="schema2.json">
</script>
Fails with:
Uncaught Error: only one instance of babel-polyfill is allowed
This issue was opened by @Bjwebb after my question at https://stackoverflow.com/questions/54706831/how-to-use-docson-widget-with-sphinx-on-readthedocs
Although I would like to have this issue solved, I reverted back to v1.1.0 of Docson and the problem disappears.
I didn’t study it in detail, but I seem to be able to avoid this by using src/widget.js instead of public/js/widget.js. Why does widget.js need to go through webpack anyway, it looks pretty self-contained and browser-compatible at a glance?