Skip to content

Commit

Permalink
fix: force yarn in netlify via netlify.toml
Browse files Browse the repository at this point in the history
- Used to guess yarn based on yarn.lock existence

Signed-off-by: Peter Lyons <pete@reactioncommerce.com>
  • Loading branch information
focusaurus committed Jun 14, 2019
1 parent 49fe946 commit 2dd4d4f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
28 changes: 28 additions & 0 deletions bin/build.sh
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 2dd4d4f

Please sign in to comment.