These are chat archives for systemjs/systemjs

Mar 2015
Matthew James Davis
Mar 31 2015 00:16
Hi all, I had a question. I added it to stack overflow because I couldn't find it there or in the docs. Please review ^_^
Matthew James Davis
Mar 31 2015 00:33
More specifically, and I asked this a while back but there was never a great solution
i have a module, a separate es6 project, that i want to import into a web application, also written in es6
i'm using babel, but it shouldn't matter, i don't think
but i try building and importing, but it looks for dependencies local to the web app, not the module
similarly if i import the source, it tries to resolve its dependencies local to the web app
theres a notion of relative dynamic loading, which is in theory what i want to leverage
but in practice i'm importing modules in standard es6 fashion, import { Class } from './file'
and './' should be my "look relative to the folder you found this file in" flag
Cody Lundquist
Mar 31 2015 20:06
Quick question about SystemJS and the CSS plugin. If you want to compile your css in a separate file for production and it adds it to the page via dynamically creating a link tag and pointing to the corrent path to load it…. Does SystemJS know if it’s been fully loaded when it’s done?
So you could get into a situation where your JS app loads before your CSS does and you get a flash of unstyled content.
Cody Lundquist
Mar 31 2015 20:22
It looks like it does do some sort of onLoad feature and return a promise.
Guy Bedford
Mar 31 2015 21:19
@meenie you don't want to dynamically create a link tag, rather manually have it present when the page loads if using separateCSS
the css plugin when loading css does wait until the css is displayed before executing the js though
Cody Lundquist
Mar 31 2015 23:29
@guybedford The problem is I’m bring in this CSS via JSPM and it’s namespacing it with a version. I don’t want to manually link to the CSS file because then when the version changes I have to update it. I could create a helper in the template language I’m using to read the config.js manifest and figure out the version and create the path, I suppose.
Is there a workflow someone is doing right now?
For that type of thing?
Jon Stevens
Mar 31 2015 23:30
es6 import the file, no?
Guy Bedford
Mar 31 2015 23:54
@meenie I meant manually linking in the CSS file created when bundling with the separateCSS option
if you're not using bundles here, then your css will be loaded fine before any script runs
all js bootstraps have a fouc from non-js to js
this just couples your css fouc with that