Skip to content

PixUI 工具集 ​

TypeScript strict

PixUI 运行时的工具集。

包含方法可以参考 t-comm 文档和源码。

1. 作者 ​

novlan1

2. 如何使用 ​

安装:

bash
pnpm add pixui-runtime

使用

ts
import { isBrowserInPixui } from 'pixui-runtime';

isBrowserInPixui();

3. 更新日志 ​

点此查看

4. 常见问题 ​

为什么从 t-comm 中迁移 ​

gamelet-pixui-frame 这个三方库有点问题,报错 external.addEventListener is not a function。

如果使用 ESM 的 import,就会导致其他模块因报错无法使用。如果使用 import() 动态引入,就需要加异步,所有方法都要改,业务也要改,改动大。如果使用 require,就没法在 ESM 中引入,可能会引起无法 tree-shaking 等问题。

综上考虑,单独拿出来,独立成包是最合适的(本质还是这个三方库写的不够好,没兼容好所有环境)。