Skip to content

Commit

Permalink
Don’t include initializer if ember-data >= v4.12
Browse files Browse the repository at this point in the history
  • Loading branch information
fsmanuel committed May 14, 2023
1 parent 5206538 commit 5a24f84
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ module.exports = {
npmDep.gt('2.0.0'))
) {
this.hasEmberData = true;
this.hasStoreReopen = true;
}

if (
npmDep.version &&
(npmDep.satisfies('>= 4.12.0') || npmDep.gt('4.12.0'))
) {
this.hasStoreReopen = false;
}

// determine if saveAs and Blob should be imported
Expand All @@ -45,14 +53,13 @@ module.exports = {
included: function included(app) {
if (this.needsFileExport) {
app.import('vendor/save-as.js');
app.import('vendor/Blob.js');
}

this._super.included.apply(this, arguments);
},

treeForApp: function (tree) {
if (!this.needsFileExport) {
if (!this.needsFileExport || !this.hasStoreReopen) {
['initializers/local-storage-adapter.js'].forEach(function (file) {
tree = stew.rm(tree, file);
});
Expand Down

0 comments on commit 5a24f84

Please # to comment.