Skip to content
This repository was archived by the owner on Mar 30, 2024. It is now read-only.

Simple Extending

Matt Karl edited this page Aug 21, 2014 · 1 revision

Here is a very basic example of how to extend the Grunt Game Builder. In this example, we're going to add grunt-exec and create a basic command to echo a string.

Add Additional Plugins

Include additional node or grunt plugins that you wish to use in your project.

npm install grunt-exec --save

./Gruntfile.js

Add custom tasks declarations to the configuration generated by the Grunt Game Builder.

module.exports = function(grunt)
{
    // Include the project builder but don't init right away!
    var config = require('grunt-game-builder')(grunt, {
        autoInit: false
    });

    // Include additions tasks
    grunt.loadNpmTasks('grunt-exec');

    // Add tasks to the config
    config.exec = {
        echo_something: 'echo "This is something"'
    };

    // Initialize the config
    grunt.initConfig(config);
};

Clone this wiki locally