I am using the 5 min quickstart from angular.io website, which contain a file structure like this:
angular2-quickstart
app
app.component.ts
boot.ts
i
Adding on top of what raheel shan said. I had to make additional change in index.html to reflect to import correct javascript file now.
Here is summary from my side.
tsconfig.json
Before
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [ "es2015", "dom" ],
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true
}
}
After:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [ "es2015", "dom" ],
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"outDir": "dist"
},
"exclude": [
"node_modules",
"typings/main",
"typings/main.d.ts"
]
}
systemjs.config.js
Before:
'app': 'app',
After:
'app': 'dist/app', //'app
index.html
Before:
System.import('main.js').catch(function(err){ console.error(err); });
After:
System.import('dist/main.js').catch(function(err){ console.error(err); });