Skip to content

Commit

Permalink
prefer this.import instead of app.import
Browse files Browse the repository at this point in the history
  • Loading branch information
brendenpalmer committed Jul 1, 2021
1 parent 704173f commit 2bcb6c3
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
'use strict';

var shouldUseInstrumentedBuild = require('./utils').shouldUseInstrumentedBuild;

module.exports = {
name: 'loader.js',

init: function() {
this._super.init && this._super.init.apply(this, arguments);

this.treePaths['vendor'] = 'dist';
},

included: function() {
if (false /* hotfix */&& shouldUseInstrumentedBuild()) {
this.app.import('vendor/loader/loader.instrument.js', {
this._importLoaderJs('vendor/loader/loader.instrument.js', {
prepend: true
})
} else {
this.app.import('vendor/loader/loader.js', {
this._importLoaderJs('vendor/loader/loader.js', {
prepend: true
});
}
},

_importLoaderJs() {
if (typeof this.import === 'function') {
return this.import(...arguments);
}

return this.app.import(...arguments);
}
};

0 comments on commit 2bcb6c3

Please sign in to comment.