Fix: 帮助文档打包失败v2

This commit is contained in:
2026-04-01 18:56:51 +08:00
parent 5b0acede89
commit ad29502488
4 changed files with 3996 additions and 8750 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,12 +1,25 @@
/**
* Fix lodash.template assignWith issue - Manual fix script
* Run this after npm/yarn install and before build
*
* Emergency patch for lodash.template@4.18.x (broken assignWith).
* When package.json "overrides" pins lodash.template@4.5.0, do NOT run this — it is unnecessary and may corrupt the file.
*
* Usage: node fix-lodash-manual.js
*/
const fs = require('fs');
const path = require('path');
const lodashTemplatePkg = path.join(__dirname, 'node_modules', 'lodash.template', 'package.json');
if (fs.existsSync(lodashTemplatePkg)) {
try {
const ver = JSON.parse(fs.readFileSync(lodashTemplatePkg, 'utf8')).version || '';
if (ver.startsWith('4.5.')) {
console.log('✓ lodash.template is already 4.5.x (overrides); skip manual patch');
process.exit(0);
}
} catch (e) {
/* continue to patch path */
}
}
const lodashTemplatePath = path.join(__dirname, 'node_modules', 'lodash.template', 'index.js');
if (!fs.existsSync(lodashTemplatePath)) {

View File

@@ -1,6 +1,13 @@
#!/bin/bash
# Fix lodash.template assignWith issue for Linux/Mac servers - V2
# Run this script after npm/yarn install
# Emergency patch for lodash.template@4.18.x only. Skip when overrides pin 4.5.0.
# Run after npm install on Linux/Mac if needed.
if [ -f "node_modules/lodash.template/package.json" ]; then
VER=$(node -p "require('./node_modules/lodash.template/package.json').version" 2>/dev/null || echo "")
case "$VER" in
4.5.*) echo "✓ lodash.template is $VER; skip manual patch"; exit 0 ;;
esac
fi
LODGASH_TEMPLATE="node_modules/lodash.template/index.js"

View File

@@ -19,14 +19,14 @@
"node": ">=18.0.0"
},
"overrides": {
"lodash": "4.17.21",
"lodash.template": "4.5.0"
},
"devDependencies": {
"dayjs": "^1.9.7",
"inquirer": "^7.1.0",
"json2yaml": "^1.1.0",
"lodash": "^4.17.21",
"lodash.assignwith": "^4.2.0",
"lodash": "4.17.21",
"vuepress": "1.9.9",
"vuepress-plugin-baidu-tongji": "^1.0.1",
"vuepress-plugin-demo-block": "^0.7.2",
@@ -37,13 +37,5 @@
"vuepress-theme-vdoing": "^1.12.9",
"yamljs": "^0.3.0"
},
"dependencies": {},
"resolutions": {
"lodash": "^4.17.21",
"lodash.template": "^4.5.0"
},
"overrides": {
"lodash": "^4.17.21",
"lodash.template": "^4.5.0"
}
}
"dependencies": {}
}