I stumbled upon this plunker while exploring Angular2 as a starting point. However, I noticed that it performs quite sluggishly, mainly because it tries to transpile everything each time it reloads:
var angularVersion = '2.0.0-rc.4';
System.config({
baseUrl: '/',
paths: {
'npmcdn:*': 'https://npmcdn.com/*'
}
});
System.config({
transpiler: 'typescript',
typescriptOptions: { emitDecoratorMetadata: true },
meta: {
'*': {
deps: [ 'zone.js', 'reflect-metadata' ]
}
}
});
System.config({
packageConfigPaths: [
"npmcdn:@*/*/package.json"
],
map: {
'@angular/core': 'npmcdn:@angular/core@'+angularVersion,
'@angular/compiler': 'npmcdn:@angular/compiler@'+angularVersion,
'@angular/common': 'npmcdn:@angular/common@'+angularVersion,
'@angular/platform-browser': 'npmcdn:@angular/platform-browser@'+angularVersion,
'@angular/platform-browser-dynamic': 'npmcdn:@angular/platform-browser-dynamic@'+angularVersion,
'rxjs': 'npmcdn:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5b292331281b6e756b756b76393e2f3a756d">aemail</a>',
'zone.js': 'npmcdn:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cdb7a2a3a8e3a7be8dfde3fbe3fcff">aemail</a>',
'reflect-metadata': 'npmcdn:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1a687f7c767f796e37777f6e7b7e7e5b446b615f6b7c7d751b667b657b6b785f7d737a717c737b767b785f3cff">aemail</a>',
"crypto": "@empty"
},
packages: {
'app': {
defaultExtension: 'ts',
main: './index.ts'
}
}
});
I have been contemplating the idea of creating a precompiled single file bundle containing all the Angular2 vendor dependencies to enhance performance, transpiling only your application code while excluding the libraries. Is there an existing solution for this?
Please advise!