Permalink
Browse files

#182: fix npm 2

  • Loading branch information...
operatino committed Sep 20, 2015
1 parent 206c23d commit 0c98b500484a6854e3ca6d9ee38df5426eabd391
Showing with 7 additions and 2 deletions.
  1. +7 −2 Gruntfile.js
@@ -1,20 +1,25 @@
'use strict';
var path = require('path');
var fs = require('fs');
var pathToApp = path.resolve('./');
var parentFolderName = path.basename(path.resolve('..'));
global.pathToApp = pathToApp;
var loadOptions = require('./core/loadOptions');
// NPM 3 compatibility fix
var getLoaderPackageName = function() {
var packageName;
var parentFolderName = path.basename(path.resolve('..'));
var isSubPackage = parentFolderName === 'node_modules';
if (isSubPackage) {
var isLocalDepsAvailable = fs.existsSync('node_modules/grunt-autoprefixer') && fs.existsSync('node_modules/grunt-contrib-cssmin');
if (isSubPackage && !isLocalDepsAvailable) {
packageName = 'load-grunt-parent-tasks';
} else {
packageName = 'load-grunt-tasks';
}
return packageName;
};

0 comments on commit 0c98b50

Please sign in to comment.