underscore-template-loader
underscore-template-loader copied to clipboard
Global underscore used when engine is specified and using imports
An interesting bug arises when both engine and imports are used: imports are correctly loaded from the specified engine and passed to the template function, but the _
symbol inside of the template function refers to the global _
instead of the engine's one.
I pinned down the problem to the usage of the Function()
syntax, here's a CodePen to prove my point: http://codepen.io/anon/pen/JRybKm?editors=0012
I think it can be easily solved by passing the engine directly in the call to Function alongside the other imports, I will file a PR to fix it soon.
I think this is somewhat related to #19. I'm interested in your PR though :).
And also related to #13.