These are chat archives for systemjs/systemjs

19th
May 2016
Ben Sandwick
@ben657
May 19 2016 08:51
Should the SystemJS Builder class from jspm 0.17 be able to sort out meta deps from dependency .json files as normal? e.g.
{
  "main": "lib/crDash.js",
  "format": "esm",
  "meta": {
    "lib/crDash.js": {
      "deps": [
        "../dist/crDashTemplates.js",
        "../dist/crDash.css!"
      ]
    }
  }
}
isn't importing the templates file
This is in a static build
Guy Bedford
@guybedford
May 19 2016 09:46
@ben657 deps metadata is not supported for es modules currently (systemjs/systemjs#1248)
Guy Bedford
@guybedford
May 19 2016 10:28
@ben657 I've been looking into this and ideally it should work actually
what module format is the crDashTemplates.js file in your example?
Scott Nicolson
@scottnicolson
May 19 2016 11:49
Hi, I am trying to get SystemJS working with mocha to allow me to test my backbone views. When i set the global.window object to anything i get the following error: ReferenceError: babel is not defined.
can anyone provide some insight?
Gion Kunz
@gionkunz
May 19 2016 12:02
Hey there. I'm writing a typescript project where I use a default ts extension for my imports. When I use System Builder, all my source code is getting transpiled by the ts loader. Is there a way I can make the builder to write System.register which contain a js extension rather than ts ?
niabot
@niabot
May 19 2016 12:18
@gionkunz Maybe i miss something, but i had the best results if i defined the module names without the extension and let SystemJS append them for me.
Gion Kunz
@gionkunz
May 19 2016 13:26
well, I'm doing that. But when I use Builder, it will normalize the paths and append the extension. However, I'd like to intercept that process so I can manually change the path Builder is using then creating the System.registerbundle
Guy Bedford
@guybedford
May 19 2016 13:29
@gionkunz if that is the goal perhaps just use a gulp task to build your typescript rather into System.register directly, before it gets to systemjs
systemjs doesn't have to take over your whole build pipeline
niabot
@niabot
May 19 2016 13:55
@guybedford Do you know a way to simplify this configuration, so that i won't have to add the "not deep wildcards"?
System.config({
    map: {
        'is':     'lib/is.js',
        'jquery': 'lib/jquery-2.1.4.js'
    },
    bundles: {
        'lib/asysshop': ['asysshop', 'asysshop/*', 'asysshop/module/*'],
        'lib/asysform': ['asysform', 'asysform/*', 'asysform/ui/*']
    },
    packages: {
        'lib': {
            defaultExtension: 'js'
        }
    }
});
Scott Nicolson
@scottnicolson
May 19 2016 14:56
@guybedford Are you able to help out with the "ReferenceError: babel is not defined" in the node environment question i asked previously?
Guy Bedford
@guybedford
May 19 2016 14:58
@scottnicolson are you using Babel 5 or the Babel 6 plugin at https://github.com/systemjs/plugin-babel?
playground
@playground
May 19 2016 15:18
@guybedford can you give pro's and con's of jspm bundle vs depcache provided that HTTP2 is enabled?
Scott Nicolson
@scottnicolson
May 19 2016 15:35
@guybedford babel 5
@guybedford 5.8.24 by the looks
Guy Bedford
@guybedford
May 19 2016 15:39
@scottnicolson adding global.window in Node may alter the way that Babel detects its execution environment.
Scott Nicolson
@scottnicolson
May 19 2016 15:42
@guybedford any suggestions? window is needed as zepto is used and as soon as i define window, i get that error
carlosagsmendes
@carlosagsmendes
May 19 2016 15:44
Hi @guybedford. I have an issue that I don't know how to address... I'm upgrading the MVVM library that we use - KnockoutJS - to the latest version. Now, due to changes in the way KnockoutJS works, after loading it I have to execute a configuration step "ko.options.deferUpdates = true;". I would like to avoid adding this to all the modules in my application after the "import ko from 'knockout';" statement. Any recommendation about how to address this?
Scott Nicolson
@scottnicolson
May 19 2016 15:46
@guybedford The issue does manifest in browser.js of the babel-core jspm package
Guy Bedford
@guybedford
May 19 2016 15:48
@carlosagsmendes try creating a wrapper module knockout-wrapped.js which contains that code before re-exporting knockout, then use map configuration to use that over the existing knockout
@scottnicolson try upgrading to the Babel 6 plugin rather following the install instructions at the link above
it's better to use Babel 6 anyway
(that's the recommended path)
Scott Nicolson
@scottnicolson
May 19 2016 15:54
okay. i will give that a go. I just set the transpiler to be babel and it only used 5. i will force it to use 6
@guybedford I will let you know how i get on.
thanks
Guy Bedford
@guybedford
May 19 2016 15:54
sure!
carlosagsmendes
@carlosagsmendes
May 19 2016 16:00
many thanks @guybedford