Cook

Work with local version of NextJS

Initialize

  • in a different shell

    # source helpers 
    . bootstrap/scripts/helpers.sh
    # change registry to local endpoint
    setRegLocal
    

git clone $NEXTJS_REPO .next
cd .next
yarn

Export

yarn export
[[ -d ../docs ]] && rm -r ../docs
mv out ../docs 
touch ../docs/.nojekyll
  • when checking with github
git add . && git commit -m "update" && git push

Add a variable to the browser

NextJS supports exposing env variables to the browser

The way we do this in Dendron is by using the _writeEnvFile method