Skip to content

Commit 33a172e

Browse files
authored
Update README.md
1 parent 36f04b7 commit 33a172e

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,82 @@ doTypeCheck();
7878

7979
```
8080

81+
### How you can add to dev bundle process
82+
83+
```javascript
84+
85+
//load all fusebox stuff, not showing here
86+
87+
// load
88+
var TypeHelper = require('fuse-box-typechecker').TypeHelper
89+
90+
//create type chacker, it will display paths its using now
91+
var typeHelper = TypeHelper({
92+
tsConfig: './tsconfig.json',
93+
basePath:'./',
94+
tsLint:'./tslint.json', //you do not haveto do tslint too.. just here to show how.
95+
name: 'App typechecker'
96+
})
97+
98+
99+
100+
101+
// this task will start fusebox
102+
var buildFuse = (production) => {
103+
104+
// init fusebox
105+
const fuse = FuseBox.init({
106+
homeDir: './src',
107+
output: './dist/$name.js',
108+
log: false,
109+
plugins: [
110+
autoLoadAureliaLoaders(),
111+
CSSPlugin(),
112+
HTMLPlugin(),
113+
RawPlugin(['.css'])
114+
]
115+
});
116+
117+
118+
119+
// vendor bundle
120+
fuse.bundle("vendor")
121+
.cache(true)
122+
.target('browser')
123+
.instructions(`
124+
+ whatwg-fetch
125+
+ something-else-u-need
126+
`)
127+
128+
129+
130+
// app bundle
131+
let app = fuse.bundle('app')
132+
.instructions(`
133+
> [main.ts]
134+
+ [**/*.{ts,html,css}]
135+
`)
136+
.target('browser')
137+
138+
139+
// is production build
140+
production ? null : app.watch()
141+
.cache(false)
142+
.sourceMaps(true)
143+
.completed(proc => {
144+
console.log(`\x1b[36m%s\x1b[0m`, `client bundled`);
145+
// run the type checking
146+
typeHelper.runSync();
147+
});
148+
149+
// run
150+
return fuse.run()
151+
}
152+
153+
```
154+
155+
156+
81157
### Output sample
82158
![Output sample](https://github.com/fuse-box/fuse-box-typechecker/raw/master/image/sampleNew2.png "Output sample")
83159

0 commit comments

Comments
 (0)