The current singleton implementation works fine, in case we are sticking to one Neo.mjs version per app.
For the LivePreview, the dynamic code can not be bundled, so when trying to build the Portal app, it could happen that we have both, the dist/production and the development versions of neo in parallel.
In this case, singleton files will get pulled in from multiple locations (file-paths). setupClass() needs to check if the namespace already exists and if so, not create a new instance or override the ns.
The current singleton implementation works fine, in case we are sticking to one Neo.mjs version per app.
For the
LivePreview
, the dynamic code can not be bundled, so when trying to build the Portal app, it could happen that we have both, thedist/production
and thedevelopment
versions of neo in parallel.In this case, singleton files will get pulled in from multiple locations (file-paths).
setupClass()
needs to check if the namespace already exists and if so, not create a new instance or override the ns.