Stack overflow after adding jekyll to gruntjs setting generated by yogurt

I have used the Yeoman yeogurt generator to run my project. The generated grunt file uses (as far as I know) include-all and grunt-jit to load modules.

What I would like to do is add the jekyll building to this file. For this I installed grunt-jekyll. Subsequently, I created a simple config file in grunt / config / compile / and added the following:

// Configuration for jekyll task(s)
// Compiles the blog
'use strict';

var taskConfig = function(grunt) {

    grunt.config.set('jekyll', {
        options: {                          // Universal options
            bundleExec: true,
            src : '<%= jekyll %>'
        },
        dist: {                             // Target
            options: {                        // Target options
                dest: '<%= dist %>/blog',
                config: '_config.yml,_config.build.yml'
            }
        }
    });

};

module.exports = taskConfig;

      

After creating this file, I tested if grunt is still working by running "grunt build" and it turns out it didn't. I am getting the following error:

Running "useminPrepare:html" (useminPrepare) task
Going through dist/index.html to update the config
Looking for build script HTML comment blocks
Fatal error: Maximum call stack size exceeded

      

I have no idea why I am getting this error as I didn’t tell grunt to do anything with jekyll (other than download), so I didn’t expect anything to change. Deleting the file makes my grunt configuration function error free.

Adding jekyll: dist to grunt / tasks / build.js results in a similar error, but in the correct module:

Running "jekyll:dist" (jekyll) task
Warning: Maximum call stack size exceeded Use --force to continue.

      

I don't know if this helps, but here is some additional information on my setup:

I think I made a mistake in my jekyll config file, but I can't see where. If anyone can help me it would be very helpful.

+3


source to share


1 answer


I don't know why this is causing a stack overflow, but the problem is that <% = dist%> and <% = jekyll%> are wrong. It should be <% = yeogurt.jekyll%> and <% = yeogurt.dist%>. This is because yeogurt is a config object, see line # 20 of your grunt file.



+1


source







All Articles