code: function require(names, callback, errback, referer) {
        // in amd, first arg can be a config object... we just ignore
        if (typeof names == 'object' && !(names instanceof Array))
          return require.apply(null, Array.prototype.splice.call(arguments, 1, arguments.length - 1));
  
        // amd require
        if (typeof names == 'string' && typeof callback == 'function')
          names = [names];
        if (names instanceof Array) {
          var dynamicRequires = [];
          for (var i = 0; i < names.length; i++)
            dynamicRequires.push(loader['import'](names[i], referer));
          Promise.all(dynamicRequires).then(function(modules) {
            if (callback)
              callback.apply(null, modules);
          }, errback);
        }
  
        // commonjs require
        else if (typeof names == 'string') {
          var defaultJSExtension = loader.defaultJSExtensions && names.substr(names.length - 3, 3) != '.js';
          var normalized = loader.decanonicalize(names, referer);
          if (defaultJSExtension && normalized.substr(normalized.length - 3, 3) == '.js')
            normalized = normalized.substr(0, normalized.length - 3);
          var module = loader.get(normalized);
          if (!module)
            throw new Error('Module not already loaded loading "' + names + '" as ' + normalized + (referer ? ' from "' + referer + '".' : '.'));
          return module.__useDefault ? module['default'] : module;
        }
  
        else
          throw new TypeError('Invalid require');
      }
docs: /*
  AMD-compatible require
  To copy RequireJS, set window.require = window.requirejs = loader.amdRequire