Umi 里的 appData.bundler 在什么情况下会被更改为 mako #12619
Answered
by
cklwblove
ShotHeadman
asked this question in
Q&A
-
我在尝试为一个修改过的umi 4框架接入mako,在构建 bundle-status.html 里面注意到构建过程里有下面一段 function renderStatus(data) {
if (data.bundler === 'mako') {
loading.setAttribute('data-mako', '');
window.__MAKO_PERCENT = window.__MAKO_PERCENT || 0.1;
const makoPercent = Math.floor(window.__MAKO_PERCENT * 100);
loading.setAttribute('data-percent', makoPercent);
window.__MAKO_PERCENT =
window.__MAKO_PERCENT >= 1 ? 0.2 : window.__MAKO_PERCENT + 0.1;
return;
}
...
} 这里面的判断条件 |
Beta Was this translation helpful? Give feedback.
Answered by
cklwblove
Aug 6, 2024
Replies: 1 comment
-
1,有关 data.bundler 的值变动为 mako,可以参考代码: 2,然后 bundle-status.htm 里 loadData 方法接收这里更改后的值: |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ShotHeadman
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
1,有关 data.bundler 的值变动为 mako,可以参考代码:
umi/packages/preset-umi/src/features/okam/okam.ts
Line 16 in c81271f
2,然后 bundle-status.htm 里 loadData 方法接收这里更改后的值:
umi/packages/preset-umi/src/features/devTool/devTool.ts
Line 40 in c81271f