Esri / ember-cli-amd

Ember CLI Addon for using AMD libraries
Apache License 2.0
21 stars 15 forks source link

after change to new version 2.0 generated index file contains no amd packages any more #44

Closed shofmannka closed 5 years ago

shofmannka commented 5 years ago

I am using an external requirejs loader and i have configured the following in ember-cli-build.js: amd : { loader: 'http://host-url:80/vp-local/resources/assets/external/requirejs/require.js', packages: ['js/qlik'], configPath: 'config/requirejs-config.js', excludePaths: [''] } the script within index.html contains no package js/qlik any more: require([ --> empty ], function() { var adoptables = []; var isVendor = new RegExp('vendor(.*js)');

  function recursiveRequire(i, scripts) {
    if (i >= scripts.length) {
      return;
    }
    require([scripts[i]], function() {
      if (isVendor.test(scripts[i])) {
        adoptables.forEach(function(adoptable) {
          enifed(adoptable.name, [], function() {
            return adoptable.obj;
          });
        });
      }
      recursiveRequire(++i, scripts);
    });
  }
  recursiveRequire(0, ["/assets/vendor.js", "/assets/qdt-requirejs.js"]);
});
shofmannka commented 5 years ago

This issue can be closed. The package section was empty because the required package was never used in code at all.