I have a Gruntfile that looks something like this (simplified for example):
module.exports = (grunt) -> grunt.initConfig config: dev: options: variables: debug: true dist: options: variables: debug: false jade: templates: options: client: true compileDebug: '<%= grunt.config.get("debug") %>' files: 'public/templates.js': ['src/jade/templates/**/*.jade'] grunt.loadNpmTasks 'grunt-config' grunt.loadNpmTasks 'grunt-contrib-jade'
The problem is that grunt-config (or perhaps a pattern parsing) converts all its parameters to strings, but the Jade compiler checks all its logical flag parameters as booleans ( if (compileDebug !== false) ). Therefore, even when running grunt config:dist jade it still generates templates with debugging logic turned on.
I know that I can get around this by duplicating the Jade configuration for two different purposes, but I would like my Gruntfile to be as dry as possible. Is there any way to do this?
source share