mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-12-01 09:07:27 +08:00
Tokenize $...$, $$...$$, \(...\) and \[...\] via a markdown-it plugin (delimiter semantics aligned with desktop), render TeX to SVG with a lazily-loaded MathJax pipeline (LRU-cached, budget-guarded) and draw it natively through react-native-svg; inline math flows with text baseline, block math centers and scrolls horizontally. Falls back to source text until MathJax is ready or when conversion fails.
18 lines
524 B
JavaScript
18 lines
524 B
JavaScript
module.exports = function (api) {
|
||
api.cache(true);
|
||
return {
|
||
presets: ['babel-preset-expo'],
|
||
plugins: [
|
||
// Reanimated 4:worklets 插件已从 reanimated 拆出,需放在插件列表最后
|
||
'react-native-worklets/plugin',
|
||
],
|
||
env: {
|
||
// jest 的 node 环境不认原生 import()(math.ts 懒加载 MathJax 用),
|
||
// 仅测试时降级成 CJS;Metro 打包不走这个分支。
|
||
test: {
|
||
plugins: ['@babel/plugin-transform-dynamic-import'],
|
||
},
|
||
},
|
||
};
|
||
};
|