新增根 biome.json(v2.5,v2 起原生支持 monorepo,子包自动向上查找):
- formatter: 2 空格缩进、单引号、行宽 100、LF、尾逗号、箭头函数括号
(匹配现有代码风格)
- linter: recommended preset + 项目化裁剪
- useTemplate/useTemplate off(geometry.ts 故意保留字符串拼接,
且测试用精确浮点断言锁定行为)
- noNonNullAssertion off(测试与 DOM 访问里的 ! 是惯用写法)
- noConsole off(4 个 lib 用 console.error/warn 做错误上报)
- CSS 关闭 noDescendingSpecificity/noDuplicateProperties
(手写 CSS 的 fallback 模式)
- useImportType/useNodejsImportProtocol/noUnusedVariables warn
- vcs.useIgnoreFile 自动读 .gitignore;排除 public/target/node_modules/
dist/.dioxus/static + Tailwind 入口 input.css(含 @theme 等 Biome 无法
解析的 at-rules)
首次格式化覆盖 29 个源文件:import 排序、node: 协议、引号/缩进统一,
并修复 index.ts 两处 forEach 回调隐式返回值(useIterableCallbackReturn)。
90 个 vitest 用例全绿,确认无语义改动。
24 lines
542 B
TypeScript
24 lines
542 B
TypeScript
import { resolve } from 'node:path';
|
|
import { defineConfig } from 'vite';
|
|
|
|
export default defineConfig({
|
|
build: {
|
|
outDir: resolve(__dirname, '../../public/yggdrasil-core'),
|
|
emptyOutDir: true,
|
|
lib: {
|
|
entry: resolve(__dirname, 'src/index.ts'),
|
|
name: 'YggdrasilCore',
|
|
fileName: () => 'yggdrasil-core.js',
|
|
formats: ['iife'],
|
|
},
|
|
rolldownOptions: {
|
|
output: {
|
|
assetFileNames: 'yggdrasil-core.[ext]',
|
|
},
|
|
},
|
|
cssCodeSplit: false,
|
|
minify: true,
|
|
sourcemap: true,
|
|
},
|
|
});
|