diff --git a/package.json b/package.json index 6f6732e848c..84a8912e8d3 100644 --- a/package.json +++ b/package.json @@ -189,7 +189,7 @@ "scripts": { "add-files-to-translate": "node scripts/actions/add-files-to-translation-queue.js", "build:production": "ENVIRONMENT=production yarn run build", - "build": "node scripts/createNetlifyRedirects.mjs & NODE_OPTIONS='--max-old-space-size=5120' gatsby build --prefix-paths", + "build": "scripts/build.sh", "check-for-outdated-translations": "node scripts/actions/check-for-outdated-translations.js", "clean": "gatsby clean", "convert-to-webp": "node scripts/convertPNGs.mjs", @@ -237,4 +237,4 @@ "bugs": { "url": "https://github.com/newrelic/docs-website/issues" } -} +} \ No newline at end of file diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 00000000000..251eb5c2a6b --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +if [[ -z "${BUILD_LANG}" ]]; then + echo "BUILD_LANG env var required 🥸 set BUILD_LANG=en for a default build" + exit 1 +else + exec node scripts/createNetlifyRedirects.mjs & NODE_OPTIONS='--max-old-space-size=5120' gatsby build --prefix-paths +fi \ No newline at end of file