These are chat archives for systemjs/systemjs

17th
Feb 2016
hschmidt99
@hschmidt99
Feb 17 2016 12:05
Is there a way to tell SystemJs to not append a default extension, when there already is an extension present?
I've got a legacy-project where views are right next to the view models and while miporting'root' leads to a request to 'root.js' thanks to default extensions, I wonder how I can manage to import 'root.html' without the request looking for 'root.html.js' :/
Kurt Westerfeld
@kwesterfeld
Feb 17 2016 13:19
For non-js files, you import root.html!text
Kurt Westerfeld
@kwesterfeld
Feb 17 2016 14:10
Question: is there a way to “globally” shim angular? I realize that a lot of add-on components will eventually be rewritten to not require shimming, but for now, I have about 10 modules I have to special-case shim. Wanting to avoid that by just doing “shim”: “*” for my whole app, indicating “angular” is global. Or maybe there’s a cleaner construct?
Micah Gajewski
@gajewsk2
Feb 17 2016 15:03
what is the advantage of using the systemjs modules instead of just global modules?
weltschmerz
@weltschmerz1
Feb 17 2016 19:49
has anybody tried to use systemjs with karma? specifically for angular 2? There is a module that I had to map to a specific path in my dev environment, but in my test environment it can't find the module even though I do the same.
I have it all written down here
so in my index.html I do
System.config({
        packages: {
          src: {
            format: 'register',
            defaultExtension: 'js'
          }
        },
        map: { '@ngrx/store' : 'node_modules/@ngrx/store/dist/store.js' } <-- this one
      });
And in my karma test shim I have tried:
System.config({
  packages: {
    'base/src': {
      defaultExtension: 'js',
      format: 'register',
      map: Object.keys(window.__karma__.files).filter(onlyAppFiles).reduce(createPathRecords, {})
    }
  },
  paths: { '@ngrx/store' : 'node_modules/@ngrx/store/dist/store.js' } <-- this one
});
but karma cannot load the file
the error I'm getting is
17 02 2016 11:51:29.026:WARN [web-server]: 404: /node_modules/@ngrx/store/dist/store.js
Chrome 48.0.2564 (Mac OS X 10.11.3) ERROR
  Error: XHR error (404 Not Found) loading http://localhost:9876/node_modules/@ngrx/store/dist/store.js
If it helps at all, I followed this guide to set up angular 2 with karma and systemjs: http://twofuckingdevelopers.com/2016/01/testing-angular-2-with-karma-and-jasmine/
Peter Müller
@Munter
Feb 17 2016 20:31
Did you tell karma to copy node modules into the web root?
natetyler
@natetyler
Feb 17 2016 20:37
I'm trying to use system.js with typescript and Electron - the electron modules are already loaded external from system.js (happens automatically with electron), how can I reference them in typescript without triggering system.js to try loading them?
weltschmerz
@weltschmerz1
Feb 17 2016 23:39
@Munter I don't think so. How do I do that?