export PATH=/usr/local/node-v20.17.0/bin:$PATH

export NPM_CONFIG_CACHE=/opt/ci-cache/npm
npm set cache "$NPM_CONFIG_CACHE"

export XDG_CACHE_HOME=/opt/ci-cache/node_modules_cache

npm set audit false
npm set fund false
npm set progress false
npm set registry registry.npmmirror.com

if [ -f package-lock.json ]; then
npm ci --ignore-scripts --loglevel=error
else
npm install --ignore-scripts --loglevel=error
fi

npm run build:${ENV}

前端cicd构建优化
展开
评论