angularsystemjsjspmyeoman-generator-angularsystemjs-builder

The globalName option must be set for full-tree rollup global and UMD builds


I have generated FountainJS angular2 project and write some code. I am using SystemJs with JSPM and TypeScript. Everything seems to work, but when i want build my project to dist, then gulp-task 'systemjs' throws me the error 'Error: The globalName option must be set for full-tree rollup global and UMD builds.', i wonder what can cause the error. I tried many things, but i am not able to find out the reason. Anyone had similar issue and knows the solution?


Solution

  • I found issue and solution for that error.

    The main cause was this line:

    import {BootstrapModalModule} from "angular2-modal/plugins/bootstrap";
    

    I didn't noticed in docs of angular2-modal that i have to add some additional configs to systemjs.config file:

    inside packages section:

    'angular2-modal': {
         defaultExtension: 'js'
         main: 'bundles/angular2-modal.umd'
    },
    'angular2-modal/plugins/bootstrap': {
         defaultExtension: 'js',
         main: `bundles/angular2-modal.bootstrap.umd`
    }
    

    inside map section:

    'angular2-modal/plugins/bootstrap': 'npm:angular2-modal@2.0.3/bundles/angular2-modal.bootstrap.umd'