underscore-template-loader icon indicating copy to clipboard operation
underscore-template-loader copied to clipboard

Global underscore used when engine is specified and using imports

Open demerzel3 opened this issue 8 years ago • 2 comments

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.

demerzel3 avatar Sep 29 '16 14:09 demerzel3

I think this is somewhat related to #19. I'm interested in your PR though :).

SpaceK33z avatar Sep 29 '16 15:09 SpaceK33z

And also related to #13.

SpaceK33z avatar Sep 29 '16 15:09 SpaceK33z