I followed the Angular 2 quickstart guide, which worked fine. But I reaaallly dislike the ts compiler they use and also don't want billions of dependencies I don't need in my node_modules folder. So I decided I was gonna build my own angular 2 project from scratch using gulp for the compiling/uglifying/concatting of my typescript code into 1 file.
Now when I run my application I see "Loading..." instead of "Hello world!".
And in my console I get the following errors:
GET http://localhost:3000/app/main.js 404 (Not Found) (zone.js:138)
Error: (SystemJS) XHR error (404 Not Found) loading ((index):37)
Im guessing something is going wrong here with my SystemJS and/or the compiling of typescript. It is looking for a 'main.js' even though I only have a 'main.ts'.
In the quickstart guide there was indeed a 'main.js' in my app folder, as a result of the compiled typescript. But since I'm using gulp, all my compiled stuff goes into a separate folder, with a separate name, so I have no 'main.js'.
At this point I can't find any solutions online and I'm already starting to miss Angular 1, so any help would be more than welcome.
I would be happy to provide any of my code if needed, but my app folder, systemjs.config.js and tsconfig.json are exactly the same as the quickstart guide.
UPDATE
This is what my systemjs.config.js looks like, as I expect that's where the problem lies. It seems to be looking for .module and .component files, but I only have 1 file: 'app.min.js' that contains all the code. Is this wrong?
/**
* System configuration for Angular samples
* Adjust as necessary for your application needs.
*/
(function (global) {
System.config({
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
// map tells the System loader where to look for things
map: {
// our app is within the app folder
app: 'dist/app',
// angular bundles
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
'@angular/router/upgrade': 'npm:@angular/router/bundles/router-upgrade.umd.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
'@angular/upgrade': 'npm:@angular/upgrade/bundles/upgrade.umd.js',
'@angular/upgrade/static': 'npm:@angular/upgrade/bundles/upgrade-static.umd.js',
// other libraries
'rxjs': 'npm:rxjs',
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
app: {
main: './app.min.js',
defaultExtension: 'js'
},
rxjs: {
defaultExtension: 'js'
}
}
});
})(this);