web-font/packages/webfont-sdk/tsdown.config.ts
崮生(子虚) 140f84d3c7 feat: uni-app 插件 gs-webfont —— 字体按需加载(子集化)上线准备
- 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
2026-08-16 10:34:40 +08:00

24 lines
646 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { defineConfig } from 'tsdown'
export default [
/** ESM + d.ts —— npm 包主产物leafer 插件 / bundler 用户api 为服务端 REST 客户端子路径 */
defineConfig({
entry: ['src/index.ts', 'src/api.ts', 'src/engine.ts'],
format: 'esm',
dts: true,
clean: true,
outDir: 'dist',
platform: 'browser',
}),
/** IIFE —— 构建为 public/webfont-sdk.jsscript 标签直引,全局 WebFont */
defineConfig({
entry: ['src/iife.ts'],
format: 'iife',
globalName: 'WebFontBundle',
clean: false,
outDir: 'dist-iife',
platform: 'browser',
minify: false,
}),
]