Skip to content

Commit

Permalink
Fix npm 2.x build failures for angular-material-source dependency
Browse files Browse the repository at this point in the history
- Angular-material-source does not have a main node module, its only
  built to ./dist and published via bower. The first attempt to make
  this work with npm 3.x broke (some users) npm 2.x env's.

- This aims to allow building a project that includes this addon for
  npme 2.x and 3.x for all versions of node.

fixes adopted-ember-addons#349
  • Loading branch information
eriktrom committed May 6, 2016
1 parent 96db7ac commit e612134
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,12 @@ module.exports = {
'components/dialog/dialog-theme.scss'
];

var pathBase = this.project.nodeModulesPath;
var angularMaterialPath = 'angular-material-source/src';
// This.nodeModulesPath is relative to either this addon or an ember project
// Its use is analogous to path.dirname(require.resolve('angular-material-source'))
// w/ diff being it resolves without relying on upstream package exporting a main module
var pathBase = path.resolve(this.nodeModulesPath, 'angular-material-source', 'src');

var angularScssFiles = new Funnel(path.join(pathBase,angularMaterialPath), {
var angularScssFiles = new Funnel(pathBase, {
files: scssFiles,
destDir: 'angular-material',
annotation: 'AngularScssFunnel'
Expand Down

0 comments on commit e612134

Please sign in to comment.