From e7355842d97fe4967d090ba41258c8b9d59f1f2d Mon Sep 17 00:00:00 2001 From: whyour Date: Sun, 16 May 2021 23:09:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=20pnpm=20=E4=BB=A3=E6=9B=BF?= =?UTF-8?q?=20yarn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + docker/Dockerfile | 5 +++-- shell/share.sh | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 5cb8f362..43f51e40 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ /yarn-error.log /yarn.lock /package-lock.json +/pnpm-lock.yaml # production /dist diff --git a/docker/Dockerfile b/docker/Dockerfile index 5c95553b..d16cfb05 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -33,7 +33,8 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && chmod 777 ${QL_DIR}/shell/*.sh \ && chmod 777 ${QL_DIR}/docker/*.sh \ && npm install -g pm2 \ + && npm install -g pnpm \ && rm -rf /root/.npm \ - && yarn install --production --network-timeout 100000 \ - && yarn cache clean + && pnpm install --prod \ + && rm -rf /root/.pnpm-store ENTRYPOINT ["./docker/docker-entrypoint.sh"] \ No newline at end of file diff --git a/shell/share.sh b/shell/share.sh index 344c9730..7b49c9e6 100755 --- a/shell/share.sh +++ b/shell/share.sh @@ -195,15 +195,15 @@ fix_config() { fi } -## npm install 子程序,判断是否为安卓,判断是否安装有yarn +## npm install 子程序,判断是否为安卓,判断是否安装有pnpm npm_install_sub() { if [ $is_termux -eq 1 ]; then npm install --production --no-save --no-bin-links --registry=https://registry.npm.taobao.org || npm install --production --no-bin-links --no-save - elif ! type yarn >/dev/null 2>&1; then + elif ! type pnpm >/dev/null 2>&1; then npm install --production --no-save --registry=https://registry.npm.taobao.org || npm install --production --no-save else - echo -e "检测到本机安装了 yarn,使用 yarn 替代 npm...\n" - yarn install --production --network-timeout 1000000000 --registry=https://registry.npm.taobao.org || yarn install --production --network-timeout 1000000000 + echo -e "检测到本机安装了 pnpm,使用 pnpm 替代 ...\n" + pnpm install --prod --registry=https://registry.npm.taobao.org || pnpm install --prod fi }