Files
zszq-trs/YLErpWeb/rebuild-bundles.sh
T
hjhan 2bfdce6ee0 [EQD-6838] 前端 bundle 确定性重建:自动生成脚本 + 发布期自动打 bundle
新增 rebuild-bundles.py/.sh/.ps1,按 bundleconfig.json 确定性重建 6 个 bundle 产物(剥 BOM、CRLF->LF、文件间换行分隔、CSS 相对 url() 重写,已逐字节比对验证与已提交版一致,其中 bundle.css 修正了历史打包产生的 CSS 注释 GBK 乱码)。
YLErpWeb.csproj 新增 GenerateBundlesBeforePublish 目标,在 publish 前自动运行脚本重建 bundle(CI 自动生效,无 python3 时优雅跳过回退已提交产物),从此改源文件后部署自动重新打 bundle,不再需要手工记得到处重建。
.gitattributes 将 bundle 锁为 eol=lf,.editorconfig 为 JS/TS 加 charset=utf-8,从根上防止 BOM/ZWNBSP 复发。
2026-07-29 17:47:13 +08:00

12 lines
486 B
Bash

#!/usr/bin/env bash
# rebuild-bundles.sh —— 委托给 rebuild-bundles.py 重建/校验前端 bundle 产物。
# CI(Linux) 在 publish 前由 YLErpWeb.csproj 的 GenerateBundlesBeforePublish 目标调用。
set -euo pipefail
DIR="$(cd "$(dirname "$0")" && pwd)"
if command -v python3 >/dev/null 2>&1; then
exec python3 "$DIR/rebuild-bundles.py" "$@"
else
echo "WARNING: python3 不可用,跳过 bundle 重建(将使用仓库内已提交的产物)。" >&2
exit 0
fi