-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grunt attempts to process htmlOutputTemplate option #357
Comments
Thanks for reporting. Works with old Grunt but seems broken with 1.0.1. Will investigate further. I don't know if it's possible for you, but if you go back to Grunt 0.4.5 it should work. |
This may be a breaking change in 1.x Grunt - I'm going to ask the folks at the Grunt repo. You identified the correct issue. The good news is that it's workaroundable by escaping the < and > chars with double backslashes. https://lodash.com/docs#template test_issue357: {
test: true,
html: ['test/test357/file.html'],
src: ['./test/test357/'],
options: {
compile: false,
htmlOutputTemplate: 'export default \'\\<%= content %\\>\''
}
} |
@gustavderdrache Thanks for the report - I think that the fix will be simply escaping the |
Sounds good. Thanks for the follow-up! |
The above workaround does not seem to work for me. output in the *.html.ts:
grunt:
grunt-ts:
-Updated |
Any news or workaround? |
Sorry I have not been able to identify a solution. |
I'm using
[email protected]
and when I specify a customhtmlOutputTemplate
, I get this fairly cryptic error:I've created a minimal configuration that reproduces the problem.
The issue appears to be the
config.get
function, which is documented to automatically process Lo-dash templates:I'm not familiar enough with Grunt to know what the fix is. Hopefully it's as simple as just reading off the configuration object without calling
get
on it. If not, would you be amenable to allowing a function instead? It could have the same signature as the Lo-dash template, that is,(variables: { content: string, modulename: string, varname: string}) => string
.The text was updated successfully, but these errors were encountered: