H5 预览与小程序产物会带出 taro_tmpl、taro-*-core、taro.js、--taro-button-height、 project.config.json 的 projectname 等指纹,而 Taro 4.3 没有隐藏这些名称的配置。 改为在 build:h5、build:weapp、build:preview 之后按 apps/taro/config/mask.config.json 做构建后处理: - 同一张替换表同时作用于文件名与文本内容,重命名后引用保持同步,长度 ≥ 40 的 base64/哈希片段原样保留; - 遮蔽后仍命中 forbidden 词表时构建失败,并把 project.config.json 的 projectname/description 中性化; - dev:h5、dev:preview 保持原始命名,便于本地调试;改架构名只改 mask.config.json; - 产物契约测试先用 unmask() 还原再断言,浏览器测试选择器写成 :is(<源码名>, <遮蔽名>)。 取舍与迁移见 docs/adr/0025-build-output-stack-masking.md。
42 lines
1.5 KiB
JSON
42 lines
1.5 KiB
JSON
{
|
|
"name": "@personal-brand/taro",
|
|
"private": true,
|
|
"scripts": {
|
|
"dev:h5": "taro build --type h5 --watch",
|
|
"dev:preview": "PREVIEW_ALL_TEMPLATES=true taro build --type h5 --watch",
|
|
"build:h5": "taro build --type h5 && node config/mask-taro.cjs h5",
|
|
"build:preview": "PREVIEW_ALL_TEMPLATES=true taro build --type h5 && node config/mask-taro.cjs h5 --preview",
|
|
"build:weapp": "taro build --type weapp && node config/mask-taro.cjs weapp",
|
|
"typecheck": "tsc --noEmit",
|
|
"lint": "pnpm --workspace-root exec eslint apps/taro/src apps/taro/config \"packages/template-*/taro/**/*.{ts,tsx}\"",
|
|
"test": "node --experimental-strip-types --test test/*.test.mjs",
|
|
"test:browser": "playwright test"
|
|
},
|
|
"dependencies": {
|
|
"@personal-brand/types": "workspace:*",
|
|
"@tarojs/components": "4.3.0",
|
|
"@tarojs/helper": "4.3.0",
|
|
"@tarojs/plugin-framework-react": "4.3.0",
|
|
"@tarojs/plugin-platform-h5": "4.3.0",
|
|
"@tarojs/plugin-platform-weapp": "4.3.0",
|
|
"@tarojs/react": "4.3.0",
|
|
"@tarojs/runtime": "4.3.0",
|
|
"@tarojs/shared": "4.3.0",
|
|
"@tarojs/taro": "4.3.0",
|
|
"react": "18.3.1",
|
|
"react-dom": "18.3.1"
|
|
},
|
|
"devDependencies": {
|
|
"@tarojs/cli": "4.3.0",
|
|
"@tarojs/vite-runner": "4.3.0",
|
|
"@types/react": "18.3.18",
|
|
"@types/react-dom": "18.3.5",
|
|
"@vitejs/plugin-react": "4.7.0",
|
|
"vite": "4.5.14",
|
|
"@types/node": "^22.10.0",
|
|
"@babel/plugin-proposal-decorators": "^7.25.9",
|
|
"@babel/plugin-transform-class-properties": "^7.25.9",
|
|
"@playwright/test": "1.58.2"
|
|
}
|
|
}
|