I am building the ts version of all files to one file and trying to use that. But it does not work with that. The normal one works. Here is the tsconfig:
"compilerOptions": {
"target": "ES5",
"module": "system",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"declaration": true,
"outDir":"client/build/",
"outFile": "all.js"
},
The html loads all.js and the system import.
<script src="client/build/all.js"></script>
<!-- 2. Configure SystemJS and Import -->
<script>
System.config({
packages: {
client: {
format: 'register',
defaultExtension: 'js'
}
}
});
System.import('client/build/all')
.then(null, console.error.bind(console));
</script>
The build happens but unable to load into index.html file. What more is needed to get this working? Second is there a minify with tsc? Note: have checked Typescript compile to single file
Update
Just upgraded to Typescript 1.9dev and getting error:
[0] node_modules/angular2/src/facade/promise.d.ts(1,10): error TS2661: Cannot re-export name that is not defined in the module. [0] client/services/httpprovider.ts(13,5): error TS4053: Return type of public method from exported class has or is using name 'Observable' from external module "c:/git/projects/edureka/yeo/2/node_modules/rxjs/Observable" but cannot be named.
Update: Now on 1.82 stable version.
Update Update: Worked with bundles config definition (Check comments for Sasxa) - https://github.com/systemjs/systemjs/blob/master/docs/production-workflows.md