emphaticsunshine
emphaticsunshine

Reputation: 3765

Gruntjs intermittently stopping at requirejs

I have created a task for build process which requirejs as one of the sub task of it and few other tasks after requirejs. The task just stops after running requirejs without throwing errors even with verbose. Any help will be appreciated.

My task looks like this:

grunt.registerTask('build','clean linter requirejs compass cssmin');

Upvotes: 4

Views: 121

Answers (2)

Anton Shuvalov
Anton Shuvalov

Reputation: 3671

In your case, the correct way to write:

grunt.registerTask('build', ['clean', 'linter', 'requirejs', 'compass', 'cssmin']);


If a task list is specified, the new task will be an alias for one or more other tasks. Whenever this "alias task" is run, every specified tasks in taskList will be run, in the order specified. The taskList argument must be an array of tasks.

grunt.registerTask(taskName, [description, ] taskList)

This example alias task defines a "default" task whereby the "jshint", "qunit", "concat" and "uglify" tasks are run automatically if Grunt is executed without specifying any tasks:

grunt.registerTask('default', ['jshint', 'qunit', 'concat', 'uglify']);

Task arguments can be specified as well. In this example, the alias "dist" runs both the "concat" and "min" tasks, each with a "dist" argument:

grunt.registerTask('dist', ['concat:dist', 'uglify:dist']);

Documentation
Source of registerTask method

Upvotes: 3

Qorbani
Qorbani

Reputation: 5905

You need to change your grunt.registerTask to following:

grunt.registerTask('build', ['clean', 'linter', 'requirejs', 'compass', 'cssmin']);

I Hope this helps, but if this not fix your issue, then as Sindre mentioned in comment, you need to provide more information.

Upvotes: 1

Related Questions