-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.fsx
56 lines (46 loc) · 1.05 KB
/
build.fsx
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#r "paket: groupref netcorebuild //"
#load ".fake/build.fsx/intellisense.fsx"
#nowarn "52"
open Fake.Core
open Fake.Core.TargetOperators
open Fake.DotNet
open Fake.IO
open Fake.IO.Globbing.Operators
open Fake.JavaScript
Target.create "Clean" (fun _ ->
!! "src/bin"
++ "src/obj"
++ "output"
|> Seq.iter Shell.cleanDir
)
Target.create "Install" (fun _ ->
DotNet.restore
(DotNet.Options.withWorkingDirectory __SOURCE_DIRECTORY__)
"Bbh.StoryBook.sln"
)
Target.create "YarnInstall" (fun _ ->
Yarn.install id
)
Target.create "Build" (fun _ ->
Yarn.exec
"webpack --mode production"
(fun o ->
{ o with WorkingDirectory = __SOURCE_DIRECTORY__ }
)
)
Target.create "Watch" (fun _ ->
Yarn.exec
"webpack-dev-server --mode development"
(fun o ->
{ o with WorkingDirectory = __SOURCE_DIRECTORY__ }
)
)
// Build order
"Clean"
==> "Install"
==> "YarnInstall"
==> "Build"
"Watch"
<== [ "YarnInstall" ]
// start build
Target.runOrDefault "Build"