Using grunt registerTask targets

In my Gruntfile.js , I have:

 grunt.initConfig({ // ... uglify: { debug: { options: { mangle: false, compress: false, beautify: true } }, }, }); grunt.registerTask('build', [ //... 'uglify', //... ]); 

I would like to have

 grunt build 

Create a native version of my js code using the default values ​​for the uglify task, and

 grunt build:debug 

create an intact version of the same code, but the option: debug has no effect - it launches the uglify task with default parameters. Any thoughts on what I can do wrong?

+4
source share
1 answer

There is no debug target in your build task. Your uglify task uglify complete. If you want your build task to run uglify:debug , you would do:

grunt.registerTask('build', ['uglify:debug']);

+5
source

All Articles