I understand that you can detect features in javascript with something like this
if(xmlhttprequest){
console.log("this browser is ajax compatible");
}
I also understand that ES6 imports are nativly compatable with some browsers if certain dev mode settings are enabled. ie
import {someExport} from './someModule.js';
My question is
Is it possible to feature detect "Import" in the like you would an object? if yes, How can it be done? Is it possible to import whole JS file (so that an ES5 Javascript which does not use Export can be imported)
I have attempted using the if(object) syntax with various variations (including with and without a from statement) but so far have had no luck
My reason for this i I have build a javascript feature which relies on Jquery and GreenSock and want the script to import these automatically in compatible browsers so the developer does not have to manually add multiple JS libraries.