Socket
Socket
Sign inDemoInstall

et-grunt

Package Overview
Dependencies
107
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    et-grunt

`et-grunt` register tasks with ease. It is a task manager which makes your life easier.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

et-grunt

Build Status

Grunt task manager including jit-grunt

et-grunt register tasks with ease. It is a task manager which makes your life easier. It also loads tasks when you really need them, using jit-grunt.

Before

grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-concat');
...

grunt.registerTask('manage:js', [
	'clean:js',
	'concat:js',
]);

grunt.registerTask('manage:assets', [
	'concat:assets',
	'copy:assets',
]);

grunt.registerTask('serve:dev', [
	'clean',
	'manage:js',
	'connect'
]);

After

require('et-grunt')(grunt, {
	manage: {
		js: [
			'clean:js',
			'concat:js'
		],
		assets: [
			'concat:assets',
			'copy:assets'
		]
	},
	serve: {
		dev: [
			'clean',
			'manage:js',
			'connect'
		]
	}
});

Install

npm install et-grunt --save-dev

or

yarn add et-grunt

Usage

require('et-grunt')(grunt, tasksAsObject);
// optional
var jitMappings = {
	yourStaticJitMappings
};

require('et-grunt')(grunt, {
	// task
	manage: {
		// default task, means just 'manage'
		default: [
			'manage:sass',
			'manage:js',
			'manage:app',
		],
		// sub task -> 'manage:js'
		js: [
			'concat:js',
			'concat:vendor',
			'clean:bower'
		],
	},
	minify: {
		js: [
			'manage:js',
			'uglify:js'
		]
	}
}, jitMappings);

Now available in your shell:

grunt manage
grunt manage:js
grunt minify:js
Gruntdefault task

The very first object value should have the value default

default: ['taskName']
Default (taskName)

In every object you can write default as key and et-grunt knows automatically that the following array should be called as default. Example:

taskName: {
	default: ['concat']
}

Available as:

grunt taskName
Subtasks (taskName:subtask)

If you want to have subtasks like manage:js then you have to nest an object into the other object. Example:

taskName: {
	subtask: ['concat:js']
}

Available as:

grunt taskName:subtask

Use jit-grunt

Note: How jit-grunt works can you read here

Use static mappings

The argument after the tasks are reserved for jit static mappings.

var jitMappings = {
	// all settings
};

require('et-grunt')(grunt, tasksAsObject, jitMappings);
Use options

require('et-grunt')(grunt, tasksAsObject)(options);

Example pluginsRoot:

require('jit-grunt')(grunt, tasksAsObject)({
  	pluginsRoot: 'other/dir'
});

Pre-Registered tasks

tasks

Default

see which tasks are available

Run grunt tasks and you will see all available tasks

Extended

  • see which options every task will need

Run grunt tasks:ext or grunt tasks:extended

Release History

  • 2016-12-02 v0.1.2 Fixed unlimited nesting
  • 2015-09-30 v0.1.1 Small fixes
  • 2015-09-30 v0.1.0 Added jit-grunt options support + pre-registered task.
  • 2015-09-25 v0.0.2 Added jit-grunt static maps support.
  • 2015-09-25 v0.0.1 First release.

LICENSE

MIT © Jan Peer Stöcklmair

Keywords

FAQs

Last updated on 08 Dec 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc