Systemjs: Upgrade from 0.21.5 to 2.1.1 not working

Created on 3 Dec 2018  路  3Comments  路  Source: systemjs/systemjs

Hi Guys,

i've Problem with the upgrade from systemjs 021.5 to 2.1.1 an i don't find a example :-(
What do I have to do to update the following source code to version 2.1.1?

index.html:
<script src="~/node_modules/systemjs/dist/system.js"></script> <script> System.import('ClientApp/main.js').catch(function (err) { console.error(err); }); </script> <script src="~/ClientApp/systemjs.config.js"></script>

systemjs.config.js:
`(function (global) {
System.config({
transpiler: 'typescript',
typescriptOptions: {
"target": "es6",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true
},
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': 'ClientApp/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/forms': 'npm:@angular/forms/bundles/forms.umd.js',

        '@angular/animations': 'npm:@angular/animations/bundles/animations.umd.js',
        '@angular/animations/browser': 'npm:@angular/animations/bundles/animations-browser.umd.js',
        '@angular/platform-browser/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.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',
        'primeng': 'npm:primeng',
        'jquery': 'npm:jquery/dist/jquery.js',
        'fullcalendar': 'npm:fullcalendar/dist/fullcalendar.min.js',
        //'moment': 'npm:moment/moment.js',
        'moment': 'npm:moment/min/moment-with-locales.min.js',
        'tslib': 'npm:tslib/tslib.js',
        'quill': 'npm:quill/dist/quill.js',
    },
    meta: {
        '@angular/*': { 'format': 'cjs' },
        '*': {
            authorization: true
        }

    },
    // packages tells the System loader how to load when no filename and/or no extension
    packages: {
        'primeng': {
            defaultExtension: 'js'
        },
        app: {
            defaultExtension: 'js',
            meta: {
                './*.js': {
                    loader: 'ClientApp/systemjs-angular-loader.js'
                }
            }
        },
        'rxjs': { main: 'index.js', defaultExtension: 'js' },
        'rxjs/ajax': { main: 'index.js', defaultExtension: 'js' },
        'rxjs/operators': { main: 'index.js', defaultExtension: 'js' },
        'rxjs/testing': { main: 'index.js', defaultExtension: 'js' },
        'rxjs/webSocket': { main: 'index.js', defaultExtension: 'js' },
        //'rxjs': { main: 'Rx' },
        quill: {
            defaultExtension: 'js'
        },
        'angular2-router-loader': {
            defaultExtension: 'js'
        },
        'moment': { defaultExtension: 'js' },
    }
});

})(this);`

Most helpful comment

@guybedford vielen Dank f眉r die R眉ckmeldung, aber gibt es auch irgendwo mal ein gescheites Beispiel? Ich habe noch keins gefunden.

All 3 comments

@zornic84 unfortunately SystemJS 2.0 is a breaking change that uses package maps to handle resolver configuration now, so you would need to rewrite this configuration into that format.

@guybedford vielen Dank f眉r die R眉ckmeldung, aber gibt es auch irgendwo mal ein gescheites Beispiel? Ich habe noch keins gefunden.

@zornic84 You can try my pet-project: https://github.com/viT-1/systemjs-ts-es6

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Nedlinin picture Nedlinin  路  7Comments

brainkim picture brainkim  路  3Comments

lucastagliani picture lucastagliani  路  3Comments

ArmorDarks picture ArmorDarks  路  7Comments

TheMcMurder picture TheMcMurder  路  3Comments