Skip to content

Commit

Permalink
Allow to opt out of classic component patching
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed May 25, 2021
1 parent ff03808 commit d67a71e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ module.exports = {
} else {
this._stripTestSelectors = !app.tests;
}

this._shouldPatchClassicComponent = !this._stripTestSelectors && addonOptions.patchClassicComponent !== false;
},

_setupPreprocessorRegistry(registry) {
Expand Down Expand Up @@ -73,7 +75,7 @@ module.exports = {
this._registeredWithBabel = true;
}

if (!this._stripTestSelectors) {
if (this._shouldPatchClassicComponent) {
host.import('vendor/ember-test-selectors/patch-component.js');
}
},
Expand All @@ -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);
}
},
Expand Down

0 comments on commit d67a71e

Please sign in to comment.