Closed tqwewe closed 5 years ago
This is how Browserify works. Tsify is a Browserify plugin and there's nothing that can be done about this.
I thought so, thanks for such a quick reply. I was able to solve it in this case by just assigning MyClass
to window.
For a more 'official' way of doing it, have a look at https://stackoverflow.com/a/41518610/6680611
Thank you, thats exactly what I needed
I'm trying to bundle some TypeScript code into one single file, and after coming across tsify, it looked perfect but unfortunately tsify wraps the bundle inside an anonymous function causing exposed functions in the main entry file to be inside it's own scope.
For example:
Will be transformed into this:
And in my particular use case, I really need
MyClass
to not be wrapped inside anything. Is there an option for this or anything I can do to get passed this?