mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-05-12 02:20:18 +08:00
v2.2.0 加的 P1/P2 桌面端组件(StartupBanner / useBackendEvents)用了 'await import(\"@tauri-apps/api/event\")' 与 '@tauri-apps/api/core',但 @tauri-apps/api 只是 @tauri-apps/plugin-shell 的 transitive,没在 BillNote_frontend/package.json 直接声明。 本地开发能跑(pnpm 节点解析容忍 transitive),但 vite 6 的 production rollup 静态分析时报: Rollup failed to resolve import "@tauri-apps/api/event" 之前我只跑了 typecheck 没跑 build,所以这个问题先在 v2.2.0 / v2.2.1 / v2.2.2 的 CI 上才暴露出来。本地 DOCKER_BUILD=1 pnpm run build 已复现并修复验证。 修:BillNote_frontend/package.json 把 '@tauri-apps/api' 加为直接依赖 (^2.10.1,与 lockfile 中已存在的 transitive 版本对齐),lockfile 同步更新。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default tseslint.config({
extends: [
// Remove ...tseslint.configs.recommended and replace with this
...tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
...tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
...tseslint.configs.stylisticTypeChecked,
],
languageOptions: {
// other options...
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
})
You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default tseslint.config({
plugins: {
// Add the react-x and react-dom plugins
'react-x': reactX,
'react-dom': reactDom,
},
rules: {
// other rules...
// Enable its recommended typescript rules
...reactX.configs['recommended-typescript'].rules,
...reactDom.configs.recommended.rules,
},
})