aurelia-breeze
aurelia-breeze copied to clipboard
Return the instance of breeze from the Configure Method
This file https://github.com/jdanyow/aurelia-breeze/blob/master/dist/aurelia-breeze.js, has a method called configure
.
The only way I have found to get webpack and aurelia-breeze to work together involves modifying this file to return the instance of breeze that is configured in there. I then can use that instance in my application.
Would you be willing to make this modification. It can be done by adding:
return breeze;
as the last line before the method closes? (Right after adapter.setHttpClientFactory(() => frameworkConfig.container.get(HttpClient));
.)
Incase you are wondering, this is what I do in my app
import {configure as configureAureliaBreeze} from 'aurelia-breeze';
import {Container} from 'aurelia-dependency-injection';
var breeze: any;
export class MyClassThatUsesBreeze {
private entityManager: breeze.EntityManager;
private metadataStore: breeze.MetadataStore;
initialize() {
breeze = configureAureliaBreeze({ container: Container.instance, globalResources: () => { } });
// other stuff to setup the MetadataStore and EntityManager (and initialize my class).
}
}
I found a way around this!
I add this to my main.ts and it adds a global instance of breeze that makes this change unnecessary:
require('expose?breeze!breeze-client/breeze.debug');
(This is only needed for Webpack.) Here is the answer on stackoverflow that showed me this.