Q:

Wrong grunt template string evaluation result

When using the following Grunt Configuration, I get 404 errors.
module.exports = function(grunt) {

var taskConfig = {
    app: 'app',
    dist: 'app'
};

grunt.initConfig({
    taskConfig: taskConfig,
    connect: {
        serveMyApp: {
            options: {
                keepalive: true,
                debug: true,
                port: '3001',
                hostname: '0.0.0.0',
                livereload: true,
                base: '<%= taskConfig.dist %>/',
                middleware: function(connect, options, middlewares) {
                    // 1. mod-rewrite behavior
                    var rules = [
                        '!\\.html|\\.js|\\.css|\\.ico|\\.svg|\\.jp(e?)g|\\.png|\\.woff|\\.gif$ /index.html'
                    ];
                    middlewares.unshift(rewrite(rules));
                    return middlewares;
                }
            }
        }
    }
);

If I would set base to a string value as follows, connect works as expected:
base: 'app/',

I was expecting the template string evaluation to generate the same string value for base, but I guess it doesn't.
What I am doing wrong?

A:

the <%= ... %> syntax is for templating. 
within your Gruntfile.js just call the variable like you would do it within any other js-file
...
base: taskConfig.dist,
...

