import syntax in typescript creating another js file in visual studio

303 views Asked by At

I am trying the angular2.0 demo project in vs2013 and I want every ts file to get compiled into a single js file for which I am using the _references.ts where I am keeping all the ts references

The problem is that if i am using the import syntax eg:

import {Component, View, bootstrap} from 'angular2/angular2'; 

Then rather than compiling into the a single file visual studio is creating a sepearte js file for that particular ts but i want that to be compiled in a single file

1

There are 1 answers

0
basarat On

i want every ts file to get compiled into a single js file for which i am using the _references.ts where i am keeping all the ts references

This is a bad idea : https://github.com/TypeStrong/atom-typescript/blob/master/docs/out.md

Using the import syntax ... but i want that to be compiled in a single file

This is not allowed in TypeScript. You should compile with something like --module systemjs and then use and external build tool too do the concatenation. Look at https://github.com/systemjs/systemjs