Bjornej / GruntLauncher

A vspackage that adds the possibility to launch Grunt tasks
MIT License
40 stars 11 forks source link

Grunt: Cannot parse Gruntfile #19

Closed MSFTW closed 10 years ago

MSFTW commented 10 years ago

I'm having trouble with grunt launcher parsing my grunt file when this section is present in the grunt.initConfig section. Can you see the problem at a glance?

    // Used to generate per environment configuration
    ngconstant: {
        options: {
            name: 'app',
            dest: '<%= myHealth.app %>/app/config.js',
            template: grunt.file.read('config/templates/_constant.ejs'),
            constants: {
                appConfig: grunt.file.readJSON('config/global.json')
            }
        },
        dev: {
            constants: {
                appConfig: grunt.file.readJSON('config/dev.json')
            }
        },
        staging: {
            constants: {
                appConfig: grunt.file.readJSON('config/staging.json')
            }
        },
        production: {
            constants: {
                appConfig: grunt.file.readJSON('config/production.json')
            }
        }
    }
MSFTW commented 10 years ago

it appears to be related to the line with 'template' on it specifically

Bjornej commented 10 years ago

Yes it seems I've forgot to add that function as recognized. When I get home I'll correct the bug and create a new version for you to try.

MSFTW commented 10 years ago

Thanks. I've cloned and tested. Adding this line: read: function(){return {};},

immediately above the readJSON line in Init.txt seems to do the trick. I would have submitted a pull request for this, but it seems I do not have permission to publish a branch in your repo :(

Either way - I look forward to being able to use this sweet plugin on my project again.

Also, Mads demoed this at TechEd a few weeks ago and it looked like he had something to set a task to run on open of a project (I.e., grunt watch). Is that something that is available now and I'm just missing it in the options somewhere? (If there's another forum I can ask this type of question or submit feedback/suggestions, please direct me there)

MSFTW commented 10 years ago

Oh - right... gotta fork first ;) Here is the pull request: https://github.com/Bjornej/GruntLauncher/pull/20

Thanks again.

Bjornej commented 10 years ago

Thanks for the pull request. I'll merge it and do a check for other missing functions then I'll publish the updated version on the gallery.

As for Mads presentation I've seen it but the ability to run grunt when opening a project or when pressing F5 it's not present in GruntLauncher.

I suppose he was using a custom project type but to know for sure you would have to ask him directly.

Bjornej commented 10 years ago

I've merged your pull request and added some other missing functions then published it on Visual Studio gallery.