Skip to content

Instantly share code, notes, and snippets.

@HarryMcCarney
Created September 1, 2025 20:51
Show Gist options
  • Select an option

  • Save HarryMcCarney/0ee4ff9ddbb2bb3657b2f07576d5123e to your computer and use it in GitHub Desktop.

Select an option

Save HarryMcCarney/0ee4ff9ddbb2bb3657b2f07576d5123e to your computer and use it in GitHub Desktop.
Build and watch fable with vite
#r "nuget: Fun.Build, 1.1.15"
open Fun.Build
open System.IO
pipeline "Client" {
description "Build and Watch Client"
stage "Restore dependencies" {
run "dotnet tool restore"
run "npm install"
}
stage "Clean artifacts" {
run(fun _ ->
if Directory.Exists "build" then
Directory.Delete("build", true)
Directory.CreateDirectory "build" |> ignore
)
}
stage "Watch" {
paralle
run "dotnet fable watch src --verbose -o build"
run "npx vite"
run "npx @tailwindcss/cli -i public/input.css -o public/style.css --watch --content \"./src/**/*.{fs}\""""
}
runIfOnlySpecified false
}
@HarryMcCarney
Copy link
Author

import { defineConfig } from 'vite';

export default defineConfig({

"server": {
    "port": "5174",
    "watch": {
        "ignored": (p => { return p.includes("ace-builds") || p.endsWith(".fs"); }),
        usePolling: true
    }
},

})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment