Skip to content

Commit

Permalink
Merge pull request #129 from SergeAstapov/avoid-bower-deprecation
Browse files Browse the repository at this point in the history
Avoid bower deprecations in ember-cli 4.3+
  • Loading branch information
quaertym committed Apr 8, 2022
2 parents be93b39 + cd88962 commit a6ee22d
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions lib/dependency-checker.js
Expand Up @@ -134,13 +134,21 @@ class EmberCLIDependencyChecker {
}

normalizedBowerDependencies() {
const npmDependencies = this.project.dependencies();
const bowerDependencies = this.project.bowerDependencies();
Object.keys(bowerDependencies).forEach((pkg) => {
if(npmDependencies.hasOwnProperty(`@bower_components/${pkg}`)) {
delete bowerDependencies[pkg];
}
});
let bowerDependencies = {};

const bowerPath = path.join(this.project.root, 'bower.json');

if (fs.existsSync(bowerPath)) {
const npmDependencies = this.project.dependencies();
bowerDependencies = this.project.bowerDependencies();

Object.keys(bowerDependencies).forEach((pkg) => {
if(npmDependencies.hasOwnProperty(`@bower_components/${pkg}`)) {
delete bowerDependencies[pkg];
}
});
}

return bowerDependencies;
}

Expand Down

0 comments on commit a6ee22d

Please sign in to comment.