These are chat archives for systemjs/systemjs

Sep 2015
Simon Hampton
Sep 20 2015 06:12
@guybedford I think I'm doing something wrong. This is what my main file looks like and jspm bundle app.js - [app] is picking up both the jquery / angular stuff, as well as all my own work. I suspect this means I have misunderstood how to use systemjs
import 'jquery';
import 'bootstrap';
import 'sage';

import angular from 'angular';
import 'angular-ui-router';
import 'angular-sanitize';
import 'angularjs-google-maps';

import Restos from './services/restos';
import SearchController from './search/search.ctrl';
import MapController from './map/map.ctrl';
import ListController from './list/list.ctrl';
import restoElem from './list/resto.dir';
import './services/dictionary';
import stringFill from './directives/stringFillDir';
import scrollOnClick from './directives/scrollOnClickDir';

angular.module("af2015App", ["ui.router", "ngMap", "ngSanitize", "afDictionary"])
.service("Restos", Restos)
.controller("searchController", SearchController)
.controller("mapController", MapController)
.controller("listController", ListController)
.directive("restoElem", restoElem)
.directive("stringFill", stringFill)
.directive("scrollOnClick", scrollOnClick);
Guy Bedford
Sep 20 2015 07:47
@simonh1000 it's a two step bundling process - the first bundle creates everything except app, the second bundle can subtract that from app to create everything in app only
try jspm bundle app/**/* - [app/**/*] common-bundle.js and then subtracting that from jspm bundle app/main.js - common-bundle.js app-bundle.js etc etc
Simon Hampton
Sep 20 2015 08:13
where shoudl the jspm_packages directory be relative to the app stuff - i.e. does bundle look at directory structures or at the imports list in a file?
Sharon (Sean) Rolel
Sep 20 2015 09:20
@guybedford I want to add a hook to any module right before it is resolved, so that import 'aModule' will return the result of my hook called with the module that would otherwise be returned
Could you point me in the right direction? I tried hijacking instantiate but I'm not sure it's going to work
Guy Bedford
Sep 20 2015 10:11
@simonh1000 bundling works in the module name space, which is the identical naming space to System.import in the browser
Guy Bedford
Sep 20 2015 10:17
@Mosho1 hooking instantiate is exactly the way to do it
Sharon (Sean) Rolel
Sep 20 2015 11:08
@guybedford thanks
btw, I've update the builder and it's so fast it's not even funny
great job on that, it started to get really slow
Sharon (Sean) Rolel
Sep 20 2015 13:21
@guybedford regarding the instantiate hook, everything seems to work, but only when I use the loader System.import, and not when I use es6 import statements. Seems like quite the different mechanism and I'm not sure how to proceed. I'll keep looking but would appreciate your insight
Sharon (Sean) Rolel
Sep 20 2015 14:00
Everything seems to get called correcly, but the module that imports the module I'm trying to modify receives a copy of the unmodified module before the instantiate hook