These are chat archives for systemjs/systemjs

29th
Sep 2015
Will Prater
@wprater
Sep 29 2015 00:14
a recent upgrade to either SystemJs or VueJs has caused VueJs to have issues. I’ve reverted VueJs back, and SystemJs as well.. but I cannot be sure SystemJs has been reverted, since it’s still having the issue. Im using jspm.. is there any steps that should be taken to be certain I got the right deps for SystemJs installed?
Mike Haas
@mikehaas763
Sep 29 2015 01:43
Does just declaring an package in System config cause that package to have a "defaultExtension"?
Jayson Harshbarger
@Hypercubed
Sep 29 2015 07:23
@simonh1000 Short answer No, I never got ng-annotate working with SystemJS. You can see my attempt here but basically had trouble because it chocked on ES6, required transpiling to CJS first, which caused issues in SystemJS builder. YMMV.
Simon Hampton
@simonh1000
Sep 29 2015 07:38
@Hypercubed Yes, I can see how nothing quite fits together properly. Trouble is that all the export/import commands that systemjs supports don't work with a more traditional ES6-Angular build
Guy Bedford
@guybedford
Sep 29 2015 10:36
@mikehaas763 as of the latest SystemJS yes
Mike Haas
@mikehaas763
Sep 29 2015 13:44
I really should check the changelog before I ask a question here lol
Sean G. Wright
@sgwatgit
Sep 29 2015 14:35
@simonh1000 I got ngannotate working with a angular-es6 + systemjs sfx build. i do my bundle first and then run the whole thing through ngannotate.
@guybedford i was looking at systemjs/builder#108 but was confused as to whether or not this functionality was actually added? can i create multiple sfx bundles, one for vendor libs (angular, d3, moment-js) and another for my app, have both bundle scripts referenced in my index.html and have it magically work?
Simon Hampton
@simonh1000
Sep 29 2015 16:14
@sgwatgit that's promising, even if I couldn't get it to work for me - will have a try and may have more questions
Simon Hampton
@simonh1000
Sep 29 2015 16:47
@sgwatgit did you add any "ngInject"s to your code to force ng-annotate to work as, after uglifying, I can't load my bundle
Vincent Martínez
@eyko
Sep 29 2015 16:58
Did ngAnnotate successfully annotate before uglifying though?
Sean G. Wright
@sgwatgit
Sep 29 2015 16:58

@simonh1000 yes - there is a trick with that too. look at the position of my annotation here https://gist.github.com/sgwatgit/95d59bee746d8ae7e111

@eyko I ran the annotation before uglifying.
My gulp build looks like "lint -> systemjs bundle sfx -> ngAnnotate -> uglify"

Simon Hampton
@simonh1000
Sep 29 2015 17:49
OK, it seems to be working and I've saved 0.5mb download!
Sean G. Wright
@sgwatgit
Sep 29 2015 19:44
@simonh1000 glad to hear. little by little we're all figuring out how to use this awesome tool.
Sean G. Wright
@sgwatgit
Sep 29 2015 21:24

Finally figured out what I assume most here already know about creating app vs dependency bundles.

I have 1 bundle for my angular app and 1 bundle for all vendor files

// creates vendor bundle without app code
builder.build('app/app.js - [app/**/*]', 'public/vendor.js', buildOptions);

// creates app bundle without vendor code
builder.build('[app/**/*]', 'public/bundle.js', buildOptions);

// public/index.html
<script src="system.js"></script> <!-- copied from /jspm_packages/system.js -->
<script src="config.js"></script> <!-- copied from /config.js -->
<script src="vendor.js"></script> <!-- placed here by the .build() -->
<script src="bundle.js"></script> <!-- placed here by the .build() -->
<script>
    System.import('app/app.js');
</script>