From d67a71e1c6b4128332c67b56fedda33b62c66609 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Tue, 25 May 2021 09:54:47 +0200 Subject: [PATCH] Allow to opt out of classic component patching --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 2b4f9286..da10cb7e 100644 --- a/index.js +++ b/index.js @@ -25,6 +25,8 @@ module.exports = { } else { this._stripTestSelectors = !app.tests; } + + this._shouldPatchClassicComponent = !this._stripTestSelectors && addonOptions.patchClassicComponent !== false; }, _setupPreprocessorRegistry(registry) { @@ -73,7 +75,7 @@ module.exports = { this._registeredWithBabel = true; } - if (!this._stripTestSelectors) { + if (this._shouldPatchClassicComponent) { host.import('vendor/ember-test-selectors/patch-component.js'); } }, @@ -89,7 +91,7 @@ module.exports = { treeForAddon() { // remove our "addon" folder from the build if we're stripping test selectors - if (!this._stripTestSelectors) { + if (this._shouldPatchClassicComponent) { return this._super.treeForAddon.apply(this, arguments); } },