gitlab & npm ci fast install All In One


gitlab & npm ci fast install All In One

gitlab ci & npm ci

緩存 npm & 緩存 node_modules

    key: node_cache
    paths:
      - .npm/
+     - node_modules/.cache
  before_script:
    - npm config set registry https://registry-cnpm.xgqfrms.xyz
    - npm ci --cache .npm --prefer-offline --no-audit

npm ci

https://docs.npmjs.com/cli/v8/commands/npm-ci

new


.npm-build-tpl-fast:
  image: node:14
  stage: build
  tags:
    - k8s
  cache:
    key: node_cache
    paths:
      - .npm/
  before_script:
    - npm config set registry https://registry-cnpm.xgqfrms.xxyz
    - npm ci --cache .npm --prefer-offline --no-audit
  script:
    - npm run build 2> /dev/null
  artifacts:
    paths:
      - dist/


old

.npm-build-tpl:
  image: node:8.9
  stage: build
  tags:
    - k8s
  cache:
    key: node_deps
    paths:
      - node_modules/
  before_script:
    - npm config set registry https://registry-cnpm.xgqfrms.xyz
  script:
    - npm install
    - npm run build 2> /dev/null
  artifacts:
    paths:
      - dist/


cache

$ npm i --prefer-offline --no-audit --progress=false

$ npm install --prefer-offline --no-audit --progress=false

refs

https://stackoverflow.com/questions/52499617/what-is-the-difference-between-npm-install-and-npm-ci

https://stackoverflow.com/questions/22077725/speeding-up-the-npm-install

https://hsiangfeng.github.io/nodejs/20211027/1827968017/



©xgqfrms 2012-2020

www.cnblogs.com/xgqfrms 發布文章使用:只允許注冊用戶才可以訪問!

原創文章,版權所有©️xgqfrms, 禁止轉載 🈲️,侵權必究⚠️!



免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM