3

I am trying to build custom themes for my users. They do so by changing some less variables. I then store these to do and grunt there theme into a css which is then uploaded to server.

My problem is with the less grunting. Here is my code:

Gruntfile.js

module.exports = function(grunt) {
     grunt.loadNpmTasks('grunt-contrib-less');
};

In nodejs

module.exports.test = function(req,res){
grunt.initConfig({
    globalConfig: {
        id: req.insertId
    },
     less: {
         default: {
             options: {
               modifyVars: req.body.less
             },
             'files': {
                 "/tmp/theme<%= globalConfig.id  %>.css": "templates/app.less"
                    }
                }
            }
        });

grunt.tasks(['less']);
});

The problem is that in my console

Running "less:default" (less) task File /tmp/theme26.css created: 0 B → 9.22 kB

Done, without errors.

worker undefined died. spawning a new process...

Why does grunt kill my process? How can I prevent this?

thomaux
  • 19,133
  • 10
  • 76
  • 103
Steeve17
  • 492
  • 6
  • 19
  • 1
    possible duplicate of [Running Node app through Grunt](http://stackoverflow.com/questions/15044026/running-node-app-through-grunt) – Paul Sweatte May 29 '14 at 22:25

0 Answers0