Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite loop when the jade task is run from another task #28

Open
leszekhanusz opened this issue Jan 12, 2016 · 0 comments
Open

Infinite loop when the jade task is run from another task #28

leszekhanusz opened this issue Jan 12, 2016 · 0 comments

Comments

@leszekhanusz
Copy link

I switched to grunt-jade-i18n from grunt-contrib-jade and I have now an infinite loop.
It is working correctly if I run grunt jade:html
It was working correctly with grunt-contrib-jade.
But an infinite loop is now present if the jade task is run from another task.

the following rule in my Gruntfile.js (simplified):

grunt.registerTask('build', function (target) {                                                                     
  if (target === 'dev') {                                                                                           
    return grunt.task.run([                                                                                         
      'jshint',                                                                                                     
      'replace:dev',                                                                                                
      'compass:dev',                                                                                                
      'jade:html'                                                                                                   
    ]);                                                                                                             
  }  
  ...
});

grunt.registerTask('rebuild_all', function (target) {                                                               

  if (target === 'jade') {                                                                                          
    return grunt.task.run([                                                                                         
      'jade:html',                                                                                                  
      'copy'                                                                                                        
    ]);                                                                                                             
  }                                                                                                                 

  grunt.task.run([                                                                                                  
    'build:dev',                                                                                                    
    'build:prod'                                                                                                    
  ]);                                                                                                               
});

The output on the console when I'm running grunt rebuild_all:jade is the following:

Running "rebuild_all:jade" (rebuild_all) task

Running "jade:html" (jade) task
>> Loading locale 'en'
>> Loading locale 'fr'
>> Loading locale 'nl'

Running "rebuild_all:contrib-jade" (rebuild_all) task

Running "build:dev" (build) task

Running "jshint:gruntfile" (jshint) task
>> 1 file lint free.

Running "jshint:js" (jshint) task
>> 27 files lint free.

Running "replace:dev" (replace) task

Running "compass:dev" (compass) task
identical app/assets/css/main.css (1.72s)
identical app/assets/css/main_gui.css (1.652s)
Compilation took 3.375s

Running "jade:html" (jade) task
>> Loading locale 'en'
>> Loading locale 'fr'
>> Loading locale 'nl'

Running "rebuild_all:contrib-jade" (rebuild_all) task

Running "build:dev" (build) task

Running "jshint:gruntfile" (jshint) task
>> 1 file lint free.

Running "jshint:js" (jshint) task
>> 27 files lint free.

Running "replace:dev" (replace) task

Running "compass:dev" (compass) task
identical app/assets/css/main.css (1.707s)
identical app/assets/css/main_gui.css (1.644s)
Compilation took 3.353s

Running "jade:html" (jade) task
>> Loading locale 'en'
>> Loading locale 'fr'
>> Loading locale 'nl'

Running "rebuild_all:contrib-jade" (rebuild_all) task

Running "build:dev" (build) task

Running "jshint:gruntfile" (jshint) task
>> 1 file lint free.

Running "jshint:js" (jshint) task
>> 27 files lint free.

Running "replace:dev" (replace) task

Running "compass:dev" (compass) task

...

If I run grunt jade, it is working correctly:

$ grunt jade                                                                                                        
Running "jade:html" (jade) task                                                                                     
>> Loading locale 'en'                                                                                              
>> Loading locale 'fr'                                                                                              
>> Loading locale 'nl'                                                                                              

Running "contrib-jade:html-en" (contrib-jade) task                                                                  
>> 2 files created.                                                                                                 

Running "contrib-jade:html-fr" (contrib-jade) task                                                                  
>> 2 files created.                                                                                                 

Running "contrib-jade:html-nl" (contrib-jade) task                                                                  
>> 2 files created.                                                                                                 

Done, without errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant