Skip to content

Instantly share code, notes, and snippets.

@brianloveswords
Created September 18, 2017 23:01
Show Gist options
  • Save brianloveswords/ba13b501c6ff9ca3a36922ecd4c78222 to your computer and use it in GitHub Desktop.
Save brianloveswords/ba13b501c6ff9ca3a36922ecd4c78222 to your computer and use it in GitHub Desktop.
TypeScript autobuild and copy to clipboard. Useful for developing stuff where you can't actually access the content directly in a text editor (e.g. tampermonkey)
{
"scripts": {
"build": "tsc && npm run post-build",
"watch": "tsc-watch --onSuccess 'npm run post-build'",
"post-build": "rollup build/index.js --o build/bundle.js --f iife && cat src/prelude.js build/bundle.js | (pbcopy && osascript -e 'display notification \"Script copied to clipboard\" with title \"Script Builder\"' || echo 'copied script to clipboard')"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment