Glue.defaults does not work w/ replace parameter
ngryman opened this issue · 1 comments
ngryman commented
Hi,
I'm currently writing a Grunt 0.4.x task for you library.
In the section Setting default values of your documentation replace
is mentioned.
I tried something like this:
var Glue = require('gluejs');
Glue.defaults({
replace: { jquery: 'window.$' }
});
var glue = new Glue();
glue.include('/path/to/some/directory');
glue.render(/*...*/);
In the output, I don't see any replacement for require('jquery')
.
If I do the following, it works:
var Glue = require('gluejs');
var glue = new Glue();
glue.include('/path/to/some/directory');
glue.replace({
jquery: 'window.$'
});
glue.render(/*...*/);
Am I missing something with the defaults
usage?
Thanks!
mixu commented
Nope, you are right - I think that feature was lost when I did a refactor a long while back. Sorry about that - I've added it in the commit above; thanks for reporting this!