Skip to content

Instantly share code, notes, and snippets.

@jamiehs
Created September 14, 2018 21:04
Show Gist options
  • Save jamiehs/fe18827ca0220b5b1c34de565d463783 to your computer and use it in GitHub Desktop.
Save jamiehs/fe18827ca0220b5b1c34de565d463783 to your computer and use it in GitHub Desktop.
When Node is installing dependancies, there is a variable we can use to conditionally run something in production/!production
{
"scripts": {
"postinstall": "if [ -n \"$npm_config_production\" ]; then npm run build; fi"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment