MasterK Posted December 7, 2015 Share Posted December 7, 2015 i use typesciprt plugin in my webstorm. 1. and when the .ts file compiled autoly, it creates a .js.map file. what's mean of it? 2. and i see the class name in .ts is Vector3, and in .js it's BABYLON.Vector3. i dont know how to set, i found it's Vector3 in my .js file compiled. Quote Link to comment Share on other sites More sharing options...
sbat Posted December 7, 2015 Share Posted December 7, 2015 1. This is source map file. It maps JS file lines to TS lines, so that you can debug TS directly in the browser or IDE. See more details here: http://www.aaron-powell.com/posts/2012-10-03-typescript-source-maps.html. If you don't need that, it is safe to ignore the files or disable their generation. Quote Link to comment Share on other sites More sharing options...
MasterK Posted December 7, 2015 Author Share Posted December 7, 2015 1. This is source map file. It maps JS file lines to TS lines, so that you can debug TS directly in the browser or IDE. See more details here: http://www.aaron-powell.com/posts/2012-10-03-typescript-source-maps.html. If you don't need that, it is safe to ignore the files or disable their generation. thanks, i choose delete the argument '-sourcemap'... 2. i can use gulp to compile all ts. But how can i compile only one ts file when i make mofidy? Quote Link to comment Share on other sites More sharing options...
sbat Posted December 7, 2015 Share Posted December 7, 2015 > 2. i can use gulp to compile all ts. But how can i compile only one ts file when i make mofidy? Webstorm comes with Typescript file watch/transpiler:https://www.jetbrains.com/webstorm/help/transpiling-typescript-to-javascript.html Every time you change a file, it will be automatically transpiled. However, you are probably using typescript "-out" (or equivalent gulp/grunt task) to combine everything to one javascript file. In this case you are out of luck, and can really do one of two things:1. (this is what I do for now) Just disable file watch, and compile everything with gulp/grunt, even if you change a single file. Typescript compiler is relatively fast, it compiles in <2 seconds for me.2. Generate separate javascript files with webstorm (and gulp for consistency). Then build your final game or load individual JS files with some external package manager (https://webpack.github.io/), which you can also invoke with gulp. I have not tried this path, but want to do that one day. Quote Link to comment Share on other sites More sharing options...
MasterK Posted December 7, 2015 Author Share Posted December 7, 2015 i think i didn't say clearly....i add file watching and it's automatically compiled... i mean gulp compile all ts files is right, but webstorm auto compile one ts file is wrong... Can't find Vector3, Color3 or so on... whatever,i use your first method now... for me, it's > 4 seconds... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.