Skip to content

Instantly share code, notes, and snippets.

@JohnnyCurran
Created September 11, 2022 21:50
Show Gist options
  • Save JohnnyCurran/1ec9d62171ab6d55eec07b9e7c2118e0 to your computer and use it in GitHub Desktop.
Save JohnnyCurran/1ec9d62171ab6d55eec07b9e7c2118e0 to your computer and use it in GitHub Desktop.
" If you are in src/Main.elm
" this will run `elm make src/Main.elm --output Main.js
" This is helpful so that `elm make` doesn't blow away index.html
" Why would you want this?
" If you're using tailwindcss, you need to link the outputted css
" in the <head> tag and `elm make` will clear it every time
" if it regenerates index.html
" set makeprg=elm\ make\ %\ --output\ '%:t:r'.js
" This makeprg assumes you're using tailwindcss and re-runs the processor
" This allows you to not dedicate a terminal process to
" npx tailwindcss --watch
" At the cost of makeprg running for a second or two more
" If you're using Dispatch.vim (and you should), this gets
" delegated to the background, and doesn't interrupt/freeze your foreground
" vim process
set makeprg=elm\ make\ %\ --output\ '%:t:r'.js\ &&\ npx\ tailwindcss\ -i\ app.css\ -o\ dist.css
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment