mirror of
https://github.com/2234839/web-font.git
synced 2026-12-01 08:13:34 +08:00
- webfont-sdk 引擎修复两处并发池 bug(原版排队分支丢任务;闭包复用会让 队列真身丢失导致 pending 卡死),新增 per-state provider 与 submitText 分批 - 新增 packages/uni-webfont:字符累积 + uni.loadFontFace 同 family 重载策略, 串行保序(maxConcurrent=1),二次 loadFont 从引擎播种累积集 - 产物同步 uni_modules/gs-webfont/js_sdk(自包含 ESM+iife+d.ts) - 端到端验证:mock 全绿;线上真实服务 4 字 → 10.1KB 合法 TTF
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import { defineConfig } from 'tsdown'
|
||
|
||
export default [
|
||
/** ESM + d.ts —— npm 包产物(bundler 用户 / CLI 工程) */
|
||
defineConfig({
|
||
entry: ['src/index.ts'],
|
||
format: 'esm',
|
||
dts: true,
|
||
clean: true,
|
||
outDir: 'dist',
|
||
platform: 'neutral',
|
||
}),
|
||
/**
|
||
* 单文件 ESM bundle(webfont-sdk 引擎内联)—— uni_modules 产物源。
|
||
* 插件市场不支持 npm 依赖,必须自包含
|
||
*/
|
||
defineConfig({
|
||
entry: ['src/index.ts'],
|
||
format: 'esm',
|
||
clean: false,
|
||
outDir: 'dist-bundle',
|
||
platform: 'neutral',
|
||
dts: false,
|
||
/**
|
||
* 全部内联:uni_modules 里没有 node_modules(本包仅依赖 webfont-sdk)。
|
||
* 不用 true:tsdown 0.22 deps 插件在 boolean 时报 pattern 空串错误
|
||
*/
|
||
noExternal: [/./],
|
||
}),
|
||
/** iife —— HBuilderX 非 CLI 工程经 script 引入,挂全局 UniWebFontBundle */
|
||
defineConfig({
|
||
entry: ['src/index.ts'],
|
||
format: 'iife',
|
||
globalName: 'UniWebFontBundle',
|
||
clean: false,
|
||
outDir: 'dist-bundle',
|
||
platform: 'neutral',
|
||
dts: false,
|
||
/** 全部内联(同上,正则形式避开 tsdown boolean bug) */
|
||
noExternal: [/./],
|
||
}),
|
||
]
|