33###How to install
44``` npm install git://github.com/fuse-box/fuse-box-aurelia-loader ```
55
6+
67###Sample
8+
79``` javascript
810
911// optional..
1012// activate logging (when aurelia developmentLogging is used)
11- ( < any > window ) .FUSEBOX_AURELIA_LOADER_LOGGING = true ;
13+ window .FUSEBOX_AURELIA_LOADER_LOGGING = true ;
1214
13- // activate hot reload, need aurelia-hot-module-reload to work, and "useCache" needs to be set to true
14- (< any> window ).FUSEBOX_AURELIA_LOADER_HMR = true ;
15-
16- // just reload document on fusebox hrm event (file change)
17- (< any> window ).FUSEBOX_AURELIA_LOADER_RELOAD = true ;
1815
1916// These can also be set by using the "EnvPlugin" in fuse.
2017// fb.EnvPlugin({
2118// FB_AU_LOG: false,
22- // FB_AU_HMR: false,
23- // FB_AU_RELOAD: true
2419// })
2520
2621// if you are having issues check console for FuseBox.import("process").env to make sure it set
2722
2823
29-
30-
24+ // the next 2 import statements can be replaced by plugin, see "autoLoadAureliaLoaders" in next code block
3125// add custom loader for fuse
3226import ' fuse-box-aurelia-loader' ;
33-
3427// start aurelia bootstrapper
3528import ' aurelia-bootstrapper' ;
3629
30+
3731// aurelia configuration
3832export function configure (aurelia ) {
3933 aurelia .use
@@ -45,3 +39,19 @@ export function configure(aurelia) {
4539```
4640
4741
42+ Simple auto load plugin to inject the loaders
43+
44+ ``` javascript
45+ var autoLoadAureliaLoaders = function () {
46+ var loader = function (){}
47+ loader .prototype .init = function (context ) {}
48+ loader .prototype .bundleEnd = function (context ) {
49+ context .source .addContent (` FuseBox.import("fuse-box-aurelia-loader")` );
50+ context .source .addContent (` FuseBox.import("aurelia-bootstrapper")` );
51+ }
52+ return new loader ();
53+ }
54+
55+
56+
57+ ```
0 commit comments