Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-subgrunt

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-subgrunt - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

6

changelog.md

@@ -0,4 +1,8 @@

### v0.2.2 [view commit logs](https://github.com/tusbar/grunt-subgrunt/compare/v0.2.1...v0.2.2)
* Add `npmClean` option to remove development dependencies after running the grunt tasks (requires npm >= 1.3.10)
### v0.2.1 [view commit logs](https://github.com/tusbar/grunt-subgrunt/compare/v0.2.0...v0.2.1)
* Propagate grunt option flags to the sub-pojects
* Propagate grunt option flags to the sub-projects

@@ -5,0 +9,0 @@ ### v0.2.0 [view commit logs](https://github.com/tusbar/grunt-subgrunt/compare/v0.1.1...v0.2.0)

2

package.json
{
"name": "grunt-subgrunt",
"version": "0.2.1",
"version": "0.2.2",
"description": "Run sub-projects' grunt tasks.",

@@ -5,0 +5,0 @@ "repository": {

@@ -56,2 +56,9 @@ # grunt-subgrunt [![Build Status](https://secure.travis-ci.org/tusbar/grunt-subgrunt.png?branch=master)](https://travis-ci.org/tusbar/grunt-subgrunt)

#### options.npmClean
Type: `bool`
Default value: `false`
*Requires npm >= 1.3.10*
When enabled, runs `npm prune --production` to clean development dependencies.
#### options.npmPath

@@ -97,2 +104,11 @@ Type: `string`

}
},
target5: {
// The npm devDependencies will be cleaned out after running the grunt tasks.
options: {
npmClean: true
},
projects: {
'node_modules/module1': [ 'preprocess', 'build' ]
}
}

@@ -99,0 +115,0 @@ }

@@ -28,2 +28,25 @@ 'use strict';

var runNpmClean = function (path, options, next) {
// Requires npm >= 1.3.10!
grunt.util.spawn({
cmd: options.npmPath,
args: [ 'prune', '--production' ],
opts: { cwd: path }
}, function (err, result, code) {
if (err || code > 0) {
grunt.log.error('Failed cleaning development dependencies in "' + path + '".');
grunt.warn('\n' + lpad(result.stderr || result.stdout, ' ! '.yellow) + '\n>>'.yellow);
}
else {
grunt.log.ok('Cleaned development dependencies in "' + path + '".');
if (result.stdout) {
grunt.log.writeln(lpad(result.stdout, ' | '));
}
}
next();
});
};
var runGruntTasks = function (path, tasks, options, next) {

@@ -56,2 +79,3 @@ var args = grunt.option.flags().concat(tasks);

npmInstall: true,
npmClean: false,
npmPath: 'npm'

@@ -83,3 +107,5 @@ });

runNpmInstall(path, options, function () {
runGruntTasks(path, tasks, options, next);
runGruntTasks(path, tasks, options, options.npmClean ? function () {
runNpmClean(path, options, next);
} : next);
});

@@ -86,0 +112,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc