It may well be that there are no versions of Discourse for which noApi
support is needed anymore, so this might be irrelevant, but I can’t seem to work out how to import a module which doesn’t exist in later versions of Discourse, in order to provide backwards compatibility, without breaking the plugin in those later versions.
The completely expected error I get (in the later versions) is:
Error: Could not find module `discourse/components/hamburger-menu` imported from `discourse/plugins/static-pages/discourse/initializers/static-pages-menu`
When trying:
import HamburgerMenuComponent from 'discourse/components/hamburger-menu';
As far as I’m aware, conditional imports aren’t possible in ES6, are they?