Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to conditionally compile (using Grunt) only changed jade files with template includes
    primarykey
    data
    text
    <p>Using a version of what <code>grunt-contrib-watch</code> recommends for compiling only changed files <em>in here</em>: <a href="https://github.com/gruntjs/grunt-contrib-watch#compiling-files-as-needed">https://github.com/gruntjs/grunt-contrib-watch#compiling-files-as-needed</a></p> <pre><code>var changedFiles = Object.create(null); var onChange = grunt.util._.debounce(function() { grunt.config('jshint.all.src', Object.keys(changedFiles)); changedFiles = Object.create(null); }, 200); grunt.event.on('watch', function(action, filepath) { changedFiles[filepath] = action; onChange(); }); </code></pre> <p>This works fine (again with a variation I wrote for it here: <a href="https://gist.github.com/pgilad/6897875">https://gist.github.com/pgilad/6897875</a>)</p> <p><strong>The problem</strong> is when using <code>include</code> inside Jade templates, meaning you are including other Jade templates in order to build the complete html file.</p> <p>Using the singular solution for compile doesn't work because if a <code>.jade</code> file you are working on is embeded using <code>include current_working_jade.jade</code> - the <strong>including file</strong> won't get recompiled.</p> <p>Are there any workarounds for this <strong><em>besides</em></strong> compiling all of your <code>jade</code> files from scratch? This causes a problem when you have around ~60 large jade files to compile every time.</p> <p>The only possible solution I can think of is either mapping jade templates dependencies either externally or with directories, but I don't know any tools/plugins which do that...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload