3 ms·
Anyone has luck with Browserify + TypeScript while keeping source maps pointing correctly back to TypeScript? (or any other JS transpiler)
by eranation 12y ago
Anyone has luck with Browserify + TypeScript while keeping source maps pointing correctly back to TypeScript? (or any other JS transpiler)
- cnp 12y agoWhat problems are you having exactly? Sourcemaps work great over here.
- eranation 12y agoHere is the SO question I created for this issue with more details: http://stackoverflow.com/questions/23453160/keep-original-typescript-source-maps-after-using-browserify http://stackoverflow.com/questions/23453160/keep-original-ty...
- chamakits 12y agoI recently also started using Browserify with Typescript (along with tds to get some ambient files for popular libraries). I got it to work after tryping countless of hacky things. What I ended up with was a seperate ts file that is just the module, and variables I export. See this: http://jsbin.com/gidaneja/1/edit?js,output http://jsbin.com/gidaneja/1/edit?js,output So I do a "<reference path=" for the ambient paths of variables. Then I declare require so I can call browserify's require. Then I create a function with it's return type being used based on ambient files I included. Then I create an export variable and call the function to set it's value. Then I can use that variable without a problem everywhere. I tried using the whole "import lodash = require('lodash.d.ts') thing and other variations and failed miserably. This is the only thing I got to work, and its working perfectly. Email me (email should be on my profile) if it's not clear, I know the explanation was kinda vague.