Differences between revisions 7 and 8
Revision 7 as of 2021-11-11 23:58:00
Size: 1649
Editor: PieterSmit
Comment:
Revision 8 as of 2021-12-01 17:08:16
Size: 1763
Editor: PieterSmit
Comment:
Deletions are marked like this. Additions are marked like this.
Line 8: Line 8:


== Node modules huge ==
 * Investigate with
    * https://npmgraph.js.org/
    * http://npm.anvaka.com/#/

Node JS

  • javascript, serverside, runs on V8-Google javascript engine.
  • Links BambooBuild

Node modules huge

NPM

Setting up nodejs in build environment, CI

  • Here we source .bash_profile, that sources nvm, as bash function.
    • Requires nvm installed and loaded by .bash_profile -> .bashrc

    • Then we use nvm, to select the nodejs version, and then we install yarn

echo "# source .bash_profile to install nvm as bash function ..."
source ~/.bash_profile

# Exit on any shell error
set -e

echo "# nodejs_version=$(printenv | grep nodejs_version)"

echo "# use nvm to switch to requested node.js version [${bamboo_nodejs_version}] ..."
nvm use ${bamboo_nodejs_version} || nvm install ${bamboo_notejs_version}

echo "# Using node: $(node --version)"
echo "# Using npm: $(npm --version)"
echo "PATH = $PATH"

npm ls -g yarn || npm install -g yarn
echo "# Using yarn: $(yarn --version)"
  • build

echo "# source .bash_profile to install nvm as bash function ..."
source ~/.bash_profile

nvm use ${bamboo_nodejs_version}
echo "# Using node: $(node --version)"
echo "# Using npm: $(npm --version)"
echo "PATH = $PATH"

yarn install
bin/pre-test-build ${bamboo.buildNumber}
yarn build --configuration=prod

...


CategoryDevelopement

nodejs (last edited 2023-10-02 09:22:10 by PieterSmit)