I wonder if it is possible to inject file paths relative to the destination file. Right now grunt-injector injects file paths relative to the gruntfile.js and there seems to be no option to control that. Except for the transform method. The problem with the transform method is that if I define it, then I'll also have to re-define how file path translates to the <script> or <link> reference. So it would be handy if there was a way to just tell grunt-injector to build paths relative to the destination file, or at least set the current working directory.
I also tried the dynamically built file objects with cwd option. The behavior has changed ('frontend/app.js' instead of './frontend/app.js') but still doesn't produce file paths relative to the cwd:
Please let me know if I'm missing something and I can build file references relative to the destination file. If not then I could suggest a pull request but need recommendation on how to do it:
extend 'relative' option to accept sting with cwd path
new boolean 'relativeToDestFile' or 'destFileRelative' option
new 'cwd' option
respect cwd option in dynamically built file objects (if feasible)
Hi,
I wonder if it is possible to inject file paths relative to the destination file. Right now grunt-injector injects file paths relative to the gruntfile.js and there seems to be no option to control that. Except for the transform method. The problem with the transform method is that if I define it, then I'll also have to re-define how file path translates to the
<script>
or<link>
reference. So it would be handy if there was a way to just tell grunt-injector to build paths relative to the destination file, or at least set the current working directory.I also tried the dynamically built file objects with cwd option. The behavior has changed ('frontend/app.js' instead of './frontend/app.js') but still doesn't produce file paths relative to the cwd:
Please let me know if I'm missing something and I can build file references relative to the destination file. If not then I could suggest a pull request but need recommendation on how to do it:
Thanks, Stas