Skip to content

Commit

Permalink
#182: applying @szarouski fix for npm 3
Browse files Browse the repository at this point in the history
  • Loading branch information
robhrt7 committed Sep 20, 2015
1 parent 23ef4b4 commit 9e58536
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
28 changes: 13 additions & 15 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,27 @@
var path = require('path');

var pathToApp = path.resolve('./');
var parentFolderName = path.basename(path.resolve('..'));
global.pathToApp = pathToApp;

var loadOptions = require('./core/loadOptions');

var getLoaderPackageName = function() {
var packageName;
var isSubPackage = parentFolderName === 'node_modules';
if (isSubPackage) {
packageName = 'load-grunt-parent-tasks';
} else {
packageName = 'load-grunt-tasks';
}
return packageName;
};

module.exports = function(grunt) {
var appPort = grunt.option('app-port') || 8080;

// load all grunt tasks matching the `grunt-*` pattern
//require('load-grunt-tasks')(grunt);
require(getLoaderPackageName())(grunt);

// measuring processing time
require('time-grunt')(grunt);
Expand Down Expand Up @@ -194,20 +206,6 @@ module.exports = function(grunt) {
}
});

// Load plugins
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-htmlmin');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-jsdoc');
grunt.loadNpmTasks('grunt-newer');
grunt.loadNpmTasks('grunt-mocha-test');

/*
*
* Custom tasks
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"grunt-newer": "~0.6.1",
"gulp-watch": "operatino/gulp-watch#4.3.5-latest-fsevents",
"jsdom": "^1.2.1",
"load-grunt-parent-tasks": "^0.1.1",
"load-grunt-tasks": "~0.3.0",
"lodash": "^3.10.1",
"log4js": "~0.6.20",
Expand Down

0 comments on commit 9e58536

Please sign in to comment.