diff --git a/bin/build.sh b/bin/build.sh new file mode 100755 index 000000000..7c4fb5fbe --- /dev/null +++ b/bin/build.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# Please Use Google Shell Style: https://google.github.io/styleguide/shell.xml + +# ---- Start unofficial bash strict mode boilerplate +# http://redsymbol.net/articles/unofficial-bash-strict-mode/ +set -o errexit # always exit on error +set -o errtrace # trap errors in functions as well +set -o pipefail # don't ignore exit codes when piping output +set -o posix # more strict failures in subshells +# set -x # enable debugging + +IFS=$'\n\t' +# ---- End unofficial bash strict mode boilerplate + +cd "$(dirname "${BASH_SOURCE[0]}")/.." +export PATH="${PWD}/node_modules/.bin:${PATH}" +declare -a args=( + --ignore-scripts + --no-lockfile + --no-progress + --non-interactive + --silent +) +yarn "${args[@]}" +cd package +yarn "${args[@]}" +yarn build diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 000000000..693e97017 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,7 @@ +[build] + environment = { YARN_VERSION = "1.16.0" } + command = "./bin/build.sh" + +[dev] + command = "yarn styleguide:build" # Command to start your dev server + port = 3999 diff --git a/package.json b/package.json index 9f544b066..0f4c9a1bd 100644 --- a/package.json +++ b/package.json @@ -171,7 +171,8 @@ "webpack": "~3.8.1", "webpack-dev-server": "~2.9.4", "webpack-manifest-plugin": "~1.3.2", - "whatwg-fetch": "~3.0.0" + "whatwg-fetch": "~3.0.0", + "yarn": "~1.16.0" }, "snyk": true, "commitlint": {