Skip to content

Commit f234892

Browse files
committed
chore(readme)
1 parent 473f414 commit f234892

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

README.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,31 @@
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
3226
import 'fuse-box-aurelia-loader';
33-
3427
// start aurelia bootstrapper
3528
import 'aurelia-bootstrapper';
3629

30+
3731
// aurelia configuration
3832
export 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

Comments
 (0)