These are chat archives for systemjs/systemjs

17th
Jan 2016
Sandeep Srinivasa
@sandys
Jan 17 2016 06:43
hi guys, how does one include a CSS file from a jspm package ?
Bnaya Peretz
@Bnaya
Jan 17 2016 08:35
@sandys dose your jspm_packages sit under your public root?
Sandeep Srinivasa
@sandys
Jan 17 2016 09:12
@Bnaya yes
thuytn
@Sophia-nguyen
Jan 17 2016 09:16
hi, Can I use builder to build html files?
Sandeep Srinivasa
@sandys
Jan 17 2016 09:59
can we include multiple json in an override.json file ? I have multiple packages - each which needs its own override
Aravinda Rao
@ManiacalAce
Jan 17 2016 11:50
are there any good resources that explain the workings of systemjs?
Sharon (Sean) Rolel
@Mosho1
Jan 17 2016 14:06
is sfxGlobals still a thing? I don't see it in the docs
Tony Xavier
@vinzandtonz
Jan 17 2016 21:18
Can anyone help me with syntax to import momentjs into my angular2 app?
version 2.11.1
gcnm-pgeil
@gcnm-pgeil
Jan 17 2016 22:37
@vinzandtonz What's the problem?
Henrik Karlsson
@ineentho
Jan 17 2016 22:39
Does anybody here have experience creating two separate apps with shared modules using one git repo?
I currently created app1/ app2/ and common/, instlalling all jspm stuff into common/, is that a good solution?
gcnm-pgeil
@gcnm-pgeil
Jan 17 2016 22:41
@ineentho JSPM is capable of using git branches or git tags as version strings.
Henrik Karlsson
@ineentho
Jan 17 2016 22:42
But as soon as I start putting it into separate repositories I loose the abillity to run everything right in the browser without using the cli to build, right?
gcnm-pgeil
@gcnm-pgeil
Jan 17 2016 22:42
you could therefore put your shared packages into their separate branches and refer to them by specifying their branch name as version string
Henrik Karlsson
@ineentho
Jan 17 2016 22:44
Then I have to re-link each time I update something in one of the common modules if I didn't miss something
gcnm-pgeil
@gcnm-pgeil
Jan 17 2016 22:45
once you checked out and initialized (installing all deps from package.json) your project you can run it in the browser and have systemjs operate on-the-fly since jspm will checkout your modules from neighbour branches into /jspm_modules/github/mypackagehere
correct
Henrik Karlsson
@ineentho
Jan 17 2016 22:46
So that's what I want to avoid by having one big project, "hacking" the config.js for each app.
Also, my coworkers aren't hyped on splitting everything into several repositories
but it seems a bit too hacky, and some stuff seems to not work correctly
gcnm-pgeil
@gcnm-pgeil
Jan 17 2016 22:48
I am not sure if i got you right: do want to keep your shared modules as independent packages which should be available on a package registry for installation or do you simply want to keep module files (=just source files) in separate base.folrders?
Because the latter is easy
Henrik Karlsson
@ineentho
Jan 17 2016 23:11
oh right, sorry, I was unclear. I want to keep them in separate folders.
@gcnm-pgeil My current setup was kind of hacked up, I hade to change paths.github and paths.npm in order to make everyhting run
gcnm-pgeil
@gcnm-pgeil
Jan 17 2016 23:19
Okay then, to accomplish this, you have two choices. 1) define the parent directory which contains app1/, app2/ and shared/ as your base dir (=baseURL property) and then you can import you shared modules everywhere with a module id like shared/mymodule.js.
Henrik Karlsson
@ineentho
Jan 17 2016 23:21
right, but then how do I import files from within app1 if I set common as the Base dir?
gcnm-pgeil
@gcnm-pgeil
Jan 17 2016 23:21
Why would you set common as base dir?
Henrik Karlsson
@ineentho
Jan 17 2016 23:22
ah right, I get what you are saying
gcnm-pgeil
@gcnm-pgeil
Jan 17 2016 23:22
common/ is just a first-level directory exactly as app1/ and app2/ are
Henrik Karlsson
@ineentho
Jan 17 2016 23:23
yeah, but I want to server app1/ as the root directory in the web server config
but I like your way, I maybe still can link /shared to the shared folder like I am doing now anyway
gcnm-pgeil
@gcnm-pgeil
Jan 17 2016 23:24
ah okay ... let me think a second
I guess in this case you must "recreate" your app1 www root dir using symlinks or so. Because in order to make systemjs work on-the-fly in the browser it needs all referenced modules to be publicly available through your webserver
Henrik Karlsson
@ineentho
Jan 17 2016 23:30
yea, that's the problem I'm facing
to be clear what I'm doing, this is the old structure I'm using right now and the new that you proposed: https://gist.github.com/ineentho/43de7f27cc2a6e42277d
the only files I will have to rewrite in nginx would be common, config.js and jspm_packages and the new structure should work, right?
gcnm-pgeil
@gcnm-pgeil
Jan 17 2016 23:37
This should work. And in your apps' index.html file you must include the systemjs loader and configure it so that common/* will resolve to ./../../common/*.
as rewrite entry in the paths property
and you must adapt the npm:* and jspm:* entries so that they point two directory hierarchy up to too
Henrik Karlsson
@ineentho
Jan 17 2016 23:42
That's still lots of things to config, I'd like to keep an as vanilla setup as possible
maybe serving the root directory as mysite.com/root and setting baseURL as /root?
that wold just be one config change, right?
and at production it shouldn't matter since everything is bundeled up and hasn't to be looked up anyway
but then I'd have to refer to internal modules as site1/src/scrip
gcnm-pgeil
@gcnm-pgeil
Jan 17 2016 23:45
correct
Henrik Karlsson
@ineentho
Jan 17 2016 23:46
which way would you do it?
gcnm-pgeil
@gcnm-pgeil
Jan 17 2016 23:47
I'd try the latter way
Henrik Karlsson
@ineentho
Jan 17 2016 23:47
right, thanks for the feedback and suggestions!
I'll try that tomorrow when I've had some sleep
gcnm-pgeil
@gcnm-pgeil
Jan 17 2016 23:47
good luck
Henrik Karlsson
@ineentho
Jan 17 2016 23:48
thanks :)