Skip to content

nqkdev/grunt-run-last

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt-run-last

Run multiple servers with support for automatically restarting on file changes.

Getting Started

This plugin requires Grunt ~0.4.5

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-run-last --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-run-last');

The "run_last" task

Overview

In your project's Gruntfile, add a section named run_last to the data object passed into grunt.initConfig().

grunt.initConfig({
  run_last: {
    server: {
      file: 'app.js',
      env: { NODE_ENV: 'production'}
    },
    nightmare: {
      file: 'nightmare.js',
    },
  },
});

Usage Examples

Combine with grunt-watch

In this example, servers reload automatically on file changes.

grunt.initConfig({
    run_last: {
      server: {
        file: 'app.js',
      },
      nightmare: {
        file: 'nightmare.js'
      }
    },

    watch: {
      options: {spawn: false},
      server: {
        files: ['*.js'],
        tasks: ['run_last:server']
      },
      nightmare: {
        files: ['nightmare.js'],
        tasks: ['run_last:nightmare']
      }
    }
});

Test

Run grunt w to start the servers. Then modify server source file(s) and save.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published