Grunt jade compiles and merges several jade files into one html

Yeoman / grunt / jade

I have a folder structure like:

App/ App/jade/user.jade /user.edit.jade /user.details.jade 

when jade matches files, it creates one html file as ( App / user.html ) for all three separate files.

I need this as all three separate files like:

 App/user.html /user.edit.html /user.details.html 

My grunt configuration:

  jade: { dist: { options: { pretty: true }, files: [{ expand: true, cwd: '<%= yeoman.app %>/jade', src: '{,*/}*.jade', dest: '<%= yeoman.app %>/', ext: '.html' }] } }, 

Am I missing something? please suggest.

+4
source share
2 answers

I do not see how it compiles user.html at all, seeing that the files array should not be inside options . The files array looks correct.

0
source

This configuration works for me:

 jade: { dist: { options: { pretty: true } files: [ expand: true, cwd: 'jade', src: [ '**/*.jade' ], dest: 'app', ext: '.html' ] } } 
0
source

Source: https://habr.com/ru/post/1480094/


All Articles