
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
grunt-generate-configs
Advanced tools


Generate separate grunt configuration files automatically
This grunt task will take your big, fat grunt configuration object and automatically generate separate files to store the task configuration objects in. It's a one time operation to be done before you start using load-grunt-configs
This plugin requires Grunt ~0.4.2
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-generate-configs
(There's no need for the --save flags, since this task should be run only once.)
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-generate-configs');
Or, if you use load-grunt-tasks it will automatically be enabled.
grunt-generate-configs has no configuration settings.
grunt generate_configs
The task will parse your grunt configuration object and automatically create files for each task.
For example, if this is your grunt configuration inside Gruntfile.js:
grunt.initConfig({
jshint : {
all : [
'Gruntfile.js', 'tasks/*.js', '<%=nodeunit.tests%>'
],
options : {
jshintrc : '.jshintrc',
},
},
// Before generating any new files, remove any previously-created files.
clean : {
config : ['config'],
},
// Unit tests.
nodeunit : {
tests : ['tests/*_test.js'],
},
});
It will create the files jshint.json, clean.json and nodeunit.json inside a config directory, containing the configuration objects:
//file: config/jshint.json
{
"all": [
"Gruntfile.js",
"tasks/*.js",
"<%=nodeunit.tests%>"
],
"options": {
"jshintrc": ".jshintrc"
}
}
//file: config/clean.json
{
"config": [
"config"
]
}
//file: config/nodeunit.json
{
"tests": [
"tests/*_test.js"
]
}
Once these files are generated, use the load-grunt-configs module to automatically load all configuration files:
npm install load-grunt-configs --save-dev
and inside your Gruntfile.js replace the grunt configuration object with:
var configs = require('load-grunt-configs')(grunt);
grunt.initConfig(configs);
See the project for more information, options and examples: load-grunt-configs
--target=<dir> you can specify the output directory using the target-flag. E.g.: grunt generate_configs --target=foo will create a foo directory instead of config.--type=[js|json] allows you to output the configuration objects as json files or javascript modules. E.g.: grunt generate_configs --type=jsCopyright (c) 2014 Camille Reynders Licensed under the MIT license.
FAQs
CLI to generate separate grunt configuration files automatically
The npm package grunt-generate-configs receives a total of 83 weekly downloads. As such, grunt-generate-configs popularity was classified as not popular.
We found that grunt-generate-configs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.