From 399abe2c20aaf86c8fdb231ca02a3dce18ee23d2 Mon Sep 17 00:00:00 2001 From: emudu Date: Fri, 15 Nov 2019 15:51:39 -0800 Subject: [PATCH 1/2] Default fileLookup to {} instead of null. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 6c8fc0c9..0344390a 100644 --- a/index.js +++ b/index.js @@ -31,7 +31,7 @@ function getPlugins(appOrAddon) { // Regular expression to extract the file extension from a path. const EXT_RE = /\.[^\.]+$/; -let fileLookup = null; +let fileLookup = {}; module.exports = { name: require('./package').name, From ade8d63a1d3da4cad443683f08d62ebc68a89969 Mon Sep 17 00:00:00 2001 From: emudu Date: Wed, 29 Jan 2020 08:40:30 -0800 Subject: [PATCH 2/2] Address review comments. --- index.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 0344390a..80c8ed7b 100644 --- a/index.js +++ b/index.js @@ -31,8 +31,6 @@ function getPlugins(appOrAddon) { // Regular expression to extract the file extension from a path. const EXT_RE = /\.[^\.]+$/; -let fileLookup = {}; - module.exports = { name: require('./package').name, @@ -43,11 +41,14 @@ module.exports = { fileLookup: null, // Ember Methods + init: function() { + this._super.init.apply(this, arguments); + this.fileLookup = {}; + }, included: function(appOrAddon) { this._super.included.apply(this, arguments); - fileLookup = this.fileLookup = {}; this.parentRegistry = appOrAddon.registry; if (!this._registeredWithBabel && this._isCoverageEnabled()) { @@ -104,7 +105,7 @@ module.exports = { attachMiddleware.serverMiddleware(startOptions.app, { configPath: this.project.configPath(), root: this.project.root, - fileLookup: fileLookup + fileLookup: this.fileLookup }); }, @@ -115,7 +116,7 @@ module.exports = { const config = { configPath: this.project.configPath(), root: this.project.root, - fileLookup: fileLookup + fileLookup: this.fileLookup }; // if we're running `ember test --server` use the `serverMiddleware`. if (process.argv.includes('--server') || process.argv.includes('-s')) {