These are chat archives for systemjs/systemjs

29th
Jan 2016
Chris Smola
@Smolations
Jan 29 2016 00:13
so if i have a define block in my main entry point that includes both dependencies from my jspm packages as well as paths to files in the app, only the jspm_packages get included in the bundle?
if so, is that happening because the jspm bundle command only works from the system config which is generated (initially) from the package.json?
Peter Uithoven
@peteruithoven
Jan 29 2016 00:34
I'm no expert but it looks through your code and finds all the dependencies, but with the - ... part I exclude my own code, leaving only the "external" dependencies.
when it runs it will lists what it bundles, so it's quite easy to check
Debjit Biswas
@debjitbis08
Jan 29 2016 06:39
@guybedford I referred this issue systemjs/builder#415
Dave
@doot0
Jan 29 2016 10:16
hey room
i’m building out an ng2 app w/ systemjs + jspm
using gulp as my build tool
I’m jumping around the web trying to come up with some kind of consensus on the best way to build out a single script
but I’m not really seeing anything concrete. maybe my google-fu is weak?
if anybody has any pointers or is using a similar stack advice would be super appreciated
Peter Uithoven
@peteruithoven
Jan 29 2016 13:09
@doot0 what do you mean with a single script? You want to put all your code into one file? wouldn't jspm bundle-sfx work?
Dave
@doot0
Jan 29 2016 13:09
this is exactly the kind of thing I’m not sure about
Peter Uithoven
@peteruithoven
Jan 29 2016 13:11
I think that's the goal of that command, what aspect seems unclear?
Dave
@doot0
Jan 29 2016 13:12
A couple things; is it even a good idea to bundle everything into one script? I feel like could potentially be counter-productive performance-wise
The other is that I’ve not used the bundler in jspm before
Before now I didn’t even know it existed
Scott Smith
@scottadamsmith
Jan 29 2016 13:12
@Smolations have tried running setmode remote? Loading those deps from the CDN during dev is pretty fast, but I can't recall if you get min versions or not.
Dave
@doot0
Jan 29 2016 13:14
additionally, if I recall correctly there’s some issue where jspm bundling of typescript (which is what we’re using) is either buggy or nonexistent
Peter Uithoven
@peteruithoven
Jan 29 2016 13:16
@doot0 I'm no expert, but the following article is quite interesting: http://engineering.khanacademy.org/posts/js-packaging-http2.htm
I think people are trying to find a middleway, but that is harder to orchestrate.
What the support for typescript is I don't know
Dave
@doot0
Jan 29 2016 13:22
thanks for the help
I appreciate it
Peter Uithoven
@peteruithoven
Jan 29 2016 13:25
I'm curious whether there is good documentation on the bundling "arithmetic"? for jspm/systemjs. Anyone?
Dave
@doot0
Jan 29 2016 16:08
when I compile an sfx bundle with var mangling turned on, I get EXCEPTION: No Directive annotation found on a in console when I try and use the built file. does anybody have any suggestions or pointers as to how to debug this? the built file works fine if I pass mangle:false
ftr I’m building ng2 and my app source
Scott Smith
@scottadamsmith
Jan 29 2016 19:09
@doot0 with all build tools I have tried I have had to disable mangling for Angular apps unfortunately
Daniel
@bitbay
Jan 29 2016 20:08
hi all!
anybody using systemjs-builder?
having some issues and i was wondering if it has some local (undocumented) cache of transpiled sources it uses to speed up bundling, since i can't see my changes in the result
Daniel
@bitbay
Jan 29 2016 20:19
shoot... had some global variables filtering into the compilation. fixed now!
Daniel Melo
@daniel-a-melo
Jan 29 2016 21:52
Hello.. I am trying to use the single file output generated by TypeScript 1.8 with SystemJS. Basically it generated a single file with SystemJS modules. I included this files with a script tag on the HTML. When I try System.import the following error is thrown : SyntaxError: Unexpected token <
Daniel Melo
@daniel-a-melo
Jan 29 2016 22:24

I tried also to load the bundle using SystemJS instead of a script tag. On config.js I added the following configuration :

  paths: {
    "github:*": "jspm_packages/github/*",
    "npm:*": "jspm_packages/npm/*",
    "ts/*" : "app.js"
  },

  meta : {
    'ts/*' : {
      format : 'register'
    }
  },

An example of one of the modules in the bundle :

System.register("ts/controllers/MenuController", ["ts/AppConfig"], function(exports_2)

SystemJS do downloads the app.js (the bundle file), but now I've got the error Error: Multiple anonymous System.register calls in module http://localhost:8080/app.js. If loading a bundle, ensure all the System.register calls are named.