From 2bcb6c36a45ecbf4b9ff635462d2f7576b5db226 Mon Sep 17 00:00:00 2001 From: Brenden Palmer Date: Thu, 1 Jul 2021 11:56:09 -0400 Subject: [PATCH] prefer `this.import` instead of `app.import` --- index.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index d701d1b..3f35936 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,5 @@ 'use strict'; + var shouldUseInstrumentedBuild = require('./utils').shouldUseInstrumentedBuild; module.exports = { @@ -6,19 +7,26 @@ module.exports = { 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); } };