Ivan Demchenko
Ivan Demchenko

Reputation: 457

Grunt and Stylus or RequireJS subtasks

It seems to me that I've missed something. Is there any possibility to make subtasks for Stylus or RequireJS within Grunt? I mean something like that:

grunt.initConfig({
    stylus: {
      dev: {
        compile: {...}
      },
      prod: {
        compile: {...}
      }
    }
});

For me it doesn't work. However when I write:

...
  stylus: {
    compile: {...}
  }
...

it work fine, creates file and so on... So what am I doing wrong?

Upvotes: 0

Views: 251

Answers (1)

kevinwolf
kevinwolf

Reputation: 274

Grunt tasks run in the next format:

taskname: {
    subtaskname: {
        // options
    }
}

So in order to make it work, you don't need to put the compile object within your dev and prod subtasks.

stylus: {
    dev: {
        // options
    },

    prod: {
        // options
    }
}

Best regards.

Upvotes: 1

Related Questions