09322ecbec
## 原来的检查是错的 它把所有 wxss 并成一个全局集合再看「这个 class 有没有人定义过」。 可这个项目连着栽的两次都是「有人定义过,但定义在别的页面里」: .post-card 留在 community.wxss,用户主页用它 → 帖子完全没样式 .profile-row 留在 settings.wxss,「我的」用它 → 四个入口整个散架 两次它都报「✓ 全部对得上」。全局并一起看,恰好检查不出这一类问题。 ## 改成按作用域 app.wxss 全局;页面 wxss 只对自己那页生效;组件 wxss 只对组件自己的节点 生效,且要开了 addGlobalClass 才看得到全局。@import 跟着递归收 (pt-icon 的图标就是这么来的)。 class 不在作用域内时分两种报法——「没有任何定义」是拼错了, 「只定义在 xxx.wxss」是跨页借用,后者直接把定义位置指出来。 ## 跑起来当场又抓到一个 pages/relations 的关注按钮 .follow-btn / .follow-btn.on 只定义在 community.wxss —— 关注/粉丝列表里那个按钮一直是裸的。已提到 app.wxss。 ## 自测过 往 learn.wxml 塞一个只在 decorate.wxss 里定义的 class,确认报错并指对了 位置,再还原确认恢复绿。不然这检查本身就是个装饰。 脚本从临时目录挪进 pets-fe/scripts/check.js(原来只活在会话的临时目录里, 会话一结束就没了),路径改成相对自己。scripts/ 加进 packOptions.ignore, 不进小程序包体。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
79 lines
1.7 KiB
JSON
79 lines
1.7 KiB
JSON
{
|
|
"description": "肉垫计划 - 新手养宠小程序",
|
|
"packOptions": {
|
|
"ignore": [
|
|
{
|
|
"type": "file",
|
|
"value": "preview.html"
|
|
},
|
|
{
|
|
"type": "file",
|
|
"value": "preview-v2.html"
|
|
},
|
|
{
|
|
"type": "folder",
|
|
"value": "assets/options"
|
|
},
|
|
{
|
|
"type": "file",
|
|
"value": "assets/logo-512.png"
|
|
},
|
|
{
|
|
"type": "file",
|
|
"value": "assets/logo-lockup.svg"
|
|
},
|
|
{
|
|
"type": "folder",
|
|
"value": "scripts"
|
|
}
|
|
],
|
|
"include": []
|
|
},
|
|
"setting": {
|
|
"urlCheck": false,
|
|
"es6": true,
|
|
"enhance": true,
|
|
"postcss": true,
|
|
"preloadBackgroundData": false,
|
|
"minified": false,
|
|
"newFeature": true,
|
|
"coverView": true,
|
|
"nodeModules": false,
|
|
"autoAudits": false,
|
|
"showShadowRootInWxmlPanel": true,
|
|
"scopeDataCheck": false,
|
|
"uglifyFileName": false,
|
|
"checkInvalidKey": true,
|
|
"checkSiteMap": true,
|
|
"uploadWithSourceMap": true,
|
|
"compileHotReLoad": false,
|
|
"babelSetting": {
|
|
"ignore": [],
|
|
"disablePlugins": [],
|
|
"outputPath": ""
|
|
},
|
|
"compileWorklet": false,
|
|
"packNpmManually": false,
|
|
"packNpmRelationList": [],
|
|
"minifyWXSS": true,
|
|
"minifyWXML": true,
|
|
"localPlugins": false,
|
|
"disableUseStrict": false,
|
|
"useCompilerPlugins": false,
|
|
"condition": false,
|
|
"swc": false,
|
|
"disableSWC": true
|
|
},
|
|
"compileType": "miniprogram",
|
|
"libVersion": "3.5.0",
|
|
"appid": "wx52dfc635739a9c19",
|
|
"projectname": "pets-fe",
|
|
"condition": {},
|
|
"editorSetting": {
|
|
"tabIndent": "insertSpaces",
|
|
"tabSize": 2
|
|
},
|
|
"miniprogramRoot": "./",
|
|
"simulatorPluginLibVersion": {}
|
|
}
|