Skip to content

Instantly share code, notes, and snippets.

@juristr
Last active May 30, 2018 08:37
Show Gist options
  • Save juristr/1230e4e3ff0247b965a0d1772f686bc7 to your computer and use it in GitHub Desktop.
Save juristr/1230e4e3ff0247b965a0d1772f686bc7 to your computer and use it in GitHub Desktop.
Plunker - Angular v5 configuration

Plunker with Angular v5

Unfortunately when you create a new Plunker demo, the files are imported in a way from NPM to always take the latest version. This is good in a way and bad in another as now with the release of Angular version 6 & RxJS 6 most Plunkers simply break.

Option 1: Upgrade your Plunks

The best option is to upgrade and give your users/readers the latest and greatest stuff Angular version 6 and RxJS version 6 provide.

Option 2: Patch your Plunks

If you cannot upgrade immediately, please consider patching your config.js in Plunker with the file below to make sure your users still have a functional and running demo 😃

Thx ❤️

System.config({
//use typescript for compilation
transpiler: 'typescript',
//typescript compiler options
typescriptOptions: {
emitDecoratorMetadata: true
},
paths: {
'npm:': 'https://unpkg.com/'
},
//map tells the System loader where to look for things
map: {
'app': './src',
'@angular/core': 'npm:@angular/[email protected]/bundles/core.umd.js',
'@angular/common': 'npm:@angular/[email protected]/bundles/common.umd.js',
'@angular/compiler': 'npm:@angular/[email protected]/bundles/compiler.umd.js',
'@angular/platform-browser': 'npm:@angular/[email protected]/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:@angular/[email protected]/bundles/platform-browser-dynamic.umd.js',
'@angular/http': 'npm:@angular/[email protected]/bundles/http.umd.js',
'@angular/router': 'npm:@angular/[email protected]/bundles/router.umd.js',
'@angular/forms': 'npm:@angular/[email protected]/bundles/forms.umd.js',
'@angular/core/testing': 'npm:@angular/[email protected]/bundles/core-testing.umd.js',
'@angular/common/testing': 'npm:@angular/[email protected]/bundles/common-testing.umd.js',
'@angular/compiler/testing': 'npm:@angular/[email protected]/bundles/compiler-testing.umd.js',
'@angular/platform-browser/testing': 'npm:@angular/[email protected]/bundles/platform-browser-testing.umd.js',
'@angular/platform-browser-dynamic/testing': 'npm:@angular/[email protected]/bundles/platform-browser-dynamic-testing.umd.js',
'@angular/http/testing': 'npm:@angular/[email protected]/bundles/http-testing.umd.js',
'@angular/router/testing': 'npm:@angular/[email protected]/bundles/router-testing.umd.js',
'rxjs': 'npm:[email protected]',
'typescript': 'npm:[email protected]/lib/typescript.js'
},
//packages defines our app package
packages: {
app: {
main: './main.ts',
defaultExtension: 'ts'
},
rxjs: {
defaultExtension: 'js'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment