You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to have a setting like grunt-contrib-copy's "cwd" argument that would allow me to output paths that reflect the actual path to the template html/haml files relative to a child folder where the templates are served. Let me explain:
As a non-fan of junk-drawer file organization, I've been building my Grunt projects with a "src" directory where my working editable files live and a "bin" folder where the processed output files (including the output template.js file) live. I keep my Gruntfile, package.json and readme in the root alongside of these project directories. In my "src" directory, I like for the files to work dynamically pulling the templates from the HTML and processing them with underscore in the browser. I have a switch that looks for the JST object and ignores the dynamic code in the bin directory.
The issue I have is that my JST paths contain 'src/' which is outside of root when serving from within the "src" or the "bin" directory. The workaround is to just use the output template.js file from the "src" directory, but I don't like the path having this artifact of the process, and it makes the src directory have a dependency on Grunt which as a matter of form, I was trying to avoid.
The text was updated successfully, but these errors were encountered:
Geez. I'm a fool. Not only did I not know this, but there's an identical ticket at the top of the closed issues with an almost identical response. Thanks for bothering to respond a second time.
just a follow up. This didn't do what I expected from the grunt-contrib-copy standpoint in changing the paths fed to the task. the cwd was just appended when passed in. Not sure what voodoo was involved there, but I ended up resolving my issue by temporarily copying my HTML templates to root, running JST on them to produce the templates.js file with the root path, then removing the copied templates folder in my final cleanup. Less elegant, but it gets the same job done.
I'd like to have a setting like grunt-contrib-copy's "cwd" argument that would allow me to output paths that reflect the actual path to the template html/haml files relative to a child folder where the templates are served. Let me explain:
As a non-fan of junk-drawer file organization, I've been building my Grunt projects with a "src" directory where my working editable files live and a "bin" folder where the processed output files (including the output template.js file) live. I keep my Gruntfile, package.json and readme in the root alongside of these project directories. In my "src" directory, I like for the files to work dynamically pulling the templates from the HTML and processing them with underscore in the browser. I have a switch that looks for the JST object and ignores the dynamic code in the bin directory.
The issue I have is that my JST paths contain 'src/' which is outside of root when serving from within the "src" or the "bin" directory. The workaround is to just use the output template.js file from the "src" directory, but I don't like the path having this artifact of the process, and it makes the src directory have a dependency on Grunt which as a matter of form, I was trying to avoid.
The text was updated successfully, but these errors were encountered: