生成 CF Pages 页面时,保护对 node_modules 的修改
黑洞 node_modules
实在不能上云
我之前在 这 霍霍了一下我用的 hexo 主题,可直到最后才发现,对友链页面的布局修改没法被送到 Cloudflare, 因为咱对 node_modules
的修改没法推上去。
本地生成不合我的本意。
这样才好:
git push origin master
咋办呢?又不能把 node_modules
上云。
做人不能,至少不应该(
Overwrite!
不如等依赖装完以后重新覆盖一遍。
我真傻,真的…
把修改的文件丢进新的文件夹,起名叫 mod
.
然后写个小脚本,让 CF 替我干活。
#!/bin/bash
hexo clean
cp -f mod/renderer.js node_modules/hexo-renderer-kramed/lib/
cp -f mod/links.ejs node_modules/hexo-theme-fluid/layout/
hexo g
添加执行权限。
chmod +x mod-build.sh
修改构建指令。
./mod-build.sh
下次 commit 时才会生效,那就再推一次。
git add .
git commit -S
git push -u origin master
它工作。
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment