Skip to content

Instantly share code, notes, and snippets.

@seanpmaxwell
Last active February 21, 2019 06:08
Show Gist options
  • Save seanpmaxwell/ec144820d40f0bcb5ac2da80fc01744f to your computer and use it in GitHub Desktop.
Save seanpmaxwell/ec144820d40f0bcb5ac2da80fc01744f to your computer and use it in GitHub Desktop.
TypeScriptFullStackShell/util/buildForProd.sh
#!/usr/bin/env bash
### Build BackEnd ###
# Remove existing production folder
rm -rf ./build/
# Transpile .ts to .js
tsc --sourceMap false
### Bundle FrontEnd ###
# Create the directory for React
mkdir -p ./build/public/react/
# Navigate to the react directory
cd ./src/public/react/demo-react
# Build React code
npm run build
# Rename the folder
mv build demo-react
# Move the contains to the build/ dir
mv demo-react ../../../../build/public/react/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment