Debugging grunts with Intellij

I am trying to debug grunt with Intellij (IDEA). Technologies: NodeJS, express, AngularJS.

Problem: The debugger does not stop at breakpoints.

I will be glad to hear your thoughts.

configuration tab:
Node interpreter: C: \ Program Files \ nodejs \ node.exe
Javscript file: C: \ Users [user] \ AppData \ Roaming \ npm \ node_modules \ grunt-cli \ bin \ grunt

Tab "Browser / Live View":

http://localhost:3000/

and here is Gruntfile.js:

var path = require('path');

module.exports = function (grunt) {

grunt.initConfig({
    express: {
        dev: {
            options: {
                script: 'server.js'
            }
        },
    },
    watch: {
        html: {
            files: [ '**/*.html'],
            options: {
                livereload: true
            }
        },
        server: {
            files: [ 'server.js'],
            tasks: ['express:dev'],
            options: {
                livereload: true,
                spawn: false // Without this option specified express won't be reloaded
            }
        },
        js: {
            files: [ '**/*.js'],
            options: {
                livereload: true
            }
        }
    },
    open: {
        express: {
            // Gets the port from the connect configuration
            path: 'http://localhost:3000'
        }
    }

});

grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-express-server');
grunt.loadNpmTasks('grunt-open');

grunt.registerTask('default', ['express:dev', 'watch' ])

};

+3
source share
2 answers

Just tried an example Angular + Express application running as a Grunt task. I used your Gruntfile.js (no change). My Node.js Run configuration looks like fololows:

:  Node : C:\Program Files\nodejs\node.exe   Javscript: C:\Users []\AppData\\npm\node_modules\grunt-cli\bin\grunt   : - , Gruntfile.js

Live Edit:     JavaScript

http://localhost:3000

.js debugger = > Angular, . :)

, :

  • ​​ debug: true dev Gruntfile.js:

: {           dev: {               : {                    script: 'server.js',                   debug: true               }           }       },

  • node_modules\grunt-express-server\tasks\lib\server.js, 65, '--debug' '--debug-brk =' ('--debug-brk = 47977 ' )
+6

JetBrains IDE Chrome, javascript, :
(: ignaciosuay.com)

grunt 9000, 3000. : grunt . , , , AngularJS Intellij.

+1

All Articles