-
Notifications
You must be signed in to change notification settings - Fork 39
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
Fails to render custom template... template file name is contents of output stylesheet #69
Comments
That was an intentional change on the current master here, which is not yet documented properly. Basically the new version will require you to pass the contents of a custom template file instead of the path. Does it work when you read the file contents with |
eh. I don't really like the idea of including the template in Gruntfile.js. It's seems cleaner to have it separated off in its own file with which I can do a It also seems harder to include a custom template if you ever provide a CLI. |
You dont have to have it in your gruntfile, you just need to read it there. And for the CLI some code would be needed anyways so than can include reading custom templates. Of course it is one more line in your gruntfile but it makes the sprite generator much more versatile. The whole code can be executed independent of the javascript runtime that is used, e.g. in the browser. See #67. |
I can't really imagine the app that would inflict that work on it's user, but I get what you're going for. It still seems like you could load the 'fs' dependency only if the config calls for it and not obliterate your legacy users like me. But I don't keep grunt running in production, so my template will only waste memory on my MacBook while 'grunt watch' is running. I guess I can deal with that. |
For each template type, lib/stylesheet/index.js calls
getTemplatedStylesheet
once passing in the contents of a file for the respective built in template, andgetTemplatedStylesheet
then returns a function that is used asrenderStylesheet
in nsg.js.However, when using a custom template file,
getTemplatedStylesheet
is passed the filename instead of the contents of the file.The text was updated successfully, but these errors were encountered: