{"action":"opened","issue":{"url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/493","labels_url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/493/labels{/name}","comments_url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/493/comments","events_url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/493/events","html_url":"https://github.com/NativeScript/nativescript-cli/issues/493","id":79043290,"number":493,"title":"Enable transpilers support in NativeScript projects","user":{"login":"ligaz","id":19437,"avatar_url":"https://avatars.githubusercontent.com/u/19437?v=3","gravatar_id":"","url":"https://api.github.com/users/ligaz","html_url":"https://github.com/ligaz","followers_url":"https://api.github.com/users/ligaz/followers","following_url":"https://api.github.com/users/ligaz/following{/other_user}","gists_url":"https://api.github.com/users/ligaz/gists{/gist_id}","starred_url":"https://api.github.com/users/ligaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ligaz/subscriptions","organizations_url":"https://api.github.com/users/ligaz/orgs","repos_url":"https://api.github.com/users/ligaz/repos","events_url":"https://api.github.com/users/ligaz/events{/privacy}","received_events_url":"https://api.github.com/users/ligaz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-21T15:24:21Z","updated_at":"2015-05-21T15:24:21Z","closed_at":null,"body":"A common request we have received in the last couple of months is the ability to enable (or start with) JavaScript transpilers for a given NativeScript project. The usual suspects are TypeScript and Babel which recently became quite popular with the approaching ratification of ES6.\r\n\r\n### Guiding principles \r\nThere a couple of guiding principles we want to follow when we enable this functionality.\r\n\r\n#### Making it generic\r\nWe want to design this feature so we can accommodate any transpiler, not just ones for JavaScript. What if you want to use LESS or Sass instead of CSS? Fan of Jade instead of XML we should have you covered. \r\n \r\n#### Per project configuration\r\nThis feature should allow usage of different version of the transpiler in different projects. For example you can use TypeScript 1.4 for your production app but switch to the cutting edge TypeScript 1.5 in your new project.\r\n\r\n#### Ability to to start with transpiler or enable it on the go\r\nWe believe that the barrier to entry for NativeScript should be as low as the one of the Web. We shouldn't force the users to learn all the cool ES6 features or TypeScript's types system. Users should be able to enable a transpiler for an already existing project or start a new project with given transpiler  if this is what they want.\r\n\r\n### The Command\r\nThe support will boil down to a single command that users will have to execute:\r\n```sh\r\n$ tns ____ typescript\r\n```\r\nor\r\n```sh\r\n$ tns ____ babel\r\n``` \r\nAs you can see we have not settled on the command name :smile: We did a little brainstorming sessions internally and we come up with `enable` (ex. `$ tns enable babel`) however this sounds too broad and we are not totally sold on it. If you have ideas how we can better name this command please file them in the comments.\r\n\r\n### Implementation details\r\nHere are some internal and more technical implementation details:\r\n* We plan to reuse our current Broccoli.js pipeline to transpile the code.\r\n* We plan to add the transpilation code itself in a project level hook.\r\n* All transpilation tools will be added as `devDependencies` to the project's `package.json`."}}