@jon, thanks for the response.
This was one of the things I tried. However, there is a subtlety here. If you were to F12 on the
in the last of your code snippets it actually takes you to the interface declaration in file
This in turn causes the compiler to infer
var endsWithFoo = 'bar-foo'.endsWith('foo');
Notice that there is no 'var str = require('./app');` since the import has been optimised away.
Perhaps this has been logged already, but I couldn't find a bug ticket for.