Skip to content

Stopping a task from watch does not seem to work #23

@nicojs

Description

@nicojs

When you try to stop a task in a watch when which was started before you get the following error:

Running "stop:server" (stop) task
Verifying property stop.server exists in config...ERROR
>> Unable to process task.
Warning: Required config property "stop.server" missing. Use --force to continue.

Aborted due to warnings.

This might be by design because watch starts a new grunt process or something, but i feel like it should work. Example grunt file:

module.exports = function (grunt) {
  require('load-grunt-tasks')(grunt);

  grunt.initConfig({
    watch: {
      ts: {
        files: ['**/*.ts'],
        tasks: ['stop:server', 'build', 'run:server']
      }
    },

    run: {
      server: {
        options: {
          wait: false,
          ready: /.*Listening on port.*/ig
        },
        args: ['./dist/app/index.js'],
      }
    },

    ts: {
      src: {
        tsconfig: true
      }
    }
  });

  grunt.registerTask('build', ['clean', 'ts']);
  grunt.registerTask('serve', ['build', 'run:server', 'watch']);
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions