获得徽章 8
- 🟢 vendor.js:长期缓存(第三方库很少更新)
🟡 app.js:短期缓存(业务代码经常更新)
🔴 runtime.js:不缓存或短期缓存(包含模块映射)
🟣 vendor-async.js:按需加载(路由懒加载时才下载)赞过评论1 - 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 registryregistry.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构建优化展开评论点赞 - 代码提交错了分支,甚至不知道在哪个分支提交的,通过下述方式找回并切到正确分支:
找分支: git log --all --grep="提交的关键词" --oneline
切换到对应的分支:git cherry-pick abc123评论点赞 - <script setup>
import { ref, onMounted } from 'vue'
const list = ref([
/* ... */
])
const itemRefs = ref([])
onMounted(() => console.log(itemRefs.value))
</script>
<template>
<ul>
<li v-for="item in list" ref="itemRefs">
{{ item }}
</li>
</ul>
</template>
itemRefs原来有数组的用法展开赞过11
![[绝望的凝视]](http://lf-web-assets.juejin.cn/obj/juejin-web/xitu_juejin_web/img/jj_emoji_69.cabd864.png)