-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfuse.js
37 lines (31 loc) · 859 Bytes
/
fuse.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const f = require("fuse-box")
, { Sparky, FuseBox:fb } = f
, path = require("path")
Sparky.task("test", () =>
fb
.init({homeDir: 'src', output: 'build/test.js'})
.bundle("app")
.instructions('[*.ts]')
.test("[**/**.test.ts]"))
Sparky.task("default", ["clean"], () => {
const build = fb.init({homeDir: 'src', output: 'build/$name.js', sourceMaps: true})
build
.bundle('test')
.instructions("> test.ts")
.sourceMaps(true)
.hmr()
.watch()
build
.dev({
open: true,
port: 4445
}, server => {
const p = path.resolve("./src/test.html")
const app = server.httpServer.app
app.get("/", (req, res) => {
res.sendFile(p)
})
})
build.run()
})
Sparky.task("clean", () => Sparky.src("build/*").clean("build/").clean(".fusebox"))