callumlocke / grunt-cdnify

Grunt plugin for finding and modifying static resource URLs
61 stars 40 forks source link

Referencing Grunt Variables? #12

Open liquidvisual opened 10 years ago

liquidvisual commented 10 years ago

I've been searching for a plugin like this for ages. Love it. Thanks for writing it!

Is there a way to reference variables further up in the file when using the rewriter? (I store all my paths at the top)

Eg:

rewriter: function (url) {
    if (url.indexOf('data:') === 0)
        return '<% yeoman.baseurl %>/' + url;
    }
lucasrudi commented 8 years ago

I have the same question, any chance of accessing to variables?

JPeer264 commented 7 years ago

@liquidvisual @lucasrudi - I think what you are looking for is grunt.config.get('yeoman.baseurl'). Make sure your paths are registered before in grunt.config.init.