@@ -38,7 +38,7 @@ run = do
3838 pkgs <- getLocalPkgs
3939 withGhciScript pkgs $ \dotGhciPath -> do
4040 freePort <- getFreePort
41− runGhcid dotGhciPath $ Just $ unwords ["main", show freePort]
41+ runGhcid dotGhciPath $ Just $ unwords ["run", show freePort, "Backend.backend", "Frontend.frontend"]
4242
4343runRepl :: MonadObelisk m => m ()
4444runRepl = do
@@ -46,6 +46,11 @@ runRepl = do
4646 withGhciScript pkgs $ \dotGhciPath -> do
4747 runGhciRepl dotGhciPath
4848
49+runWatch :: MonadObelisk m => m ()
50+runWatch = do
51+ pkgs <- getLocalPkgs
52+ withGhciScript pkgs $ \dotGhciPath -> runGhcid dotGhciPath Nothing
53+
4954-- | Relative paths to local packages of an obelisk project
5055-- TODO a way to query this
5156getLocalPkgs :: Applicative f => f [FilePath]
@@ -98,7 +103,10 @@ withGhciScript pkgs f = do
98103
99104 let dotGhci = unlines
100105 [ ":set -i" <> intercalate ":" (mconcat hsSrcDirs)
101− , ":load ./devel/Devel.hs" -- TODO more robust filepath
106+ , ":load Backend Frontend"
107+ , "import Obelisk.Run"
108+ , "import qualified Frontend"
109+ , "import qualified Backend"
102110 ]
103111 withSystemTempDirectory "ob-ghci" $ \fp -> do
104112 let dotGhciPath = fp </> ".ghci"