Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

umi.ts 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // @ts-nocheck
  2. // This file is generated by Umi automatically
  3. // DO NOT CHANGE IT MANUALLY!
  4. import './core/polyfill';
  5. import 'antd/dist/reset.css';
  6. import { renderClient } from 'E:/项目/outpackage/rencaishichanghoutai/node_modules/@umijs/renderer-react';
  7. import { getRoutes } from './core/route';
  8. import { createPluginManager } from './core/plugin';
  9. import { createHistory } from './core/history';
  10. import { ApplyPluginsType } from 'umi';
  11. const publicPath = "/";
  12. const runtimePublicPath = false;
  13. async function render() {
  14. const pluginManager = createPluginManager();
  15. const { routes, routeComponents } = await getRoutes(pluginManager);
  16. // allow user to extend routes
  17. await pluginManager.applyPlugins({
  18. key: 'patchRoutes',
  19. type: ApplyPluginsType.event,
  20. args: {
  21. routes,
  22. routeComponents,
  23. },
  24. });
  25. const contextOpts = pluginManager.applyPlugins({
  26. key: 'modifyContextOpts',
  27. type: ApplyPluginsType.modify,
  28. initialValue: {},
  29. });
  30. const basename = contextOpts.basename || '/';
  31. const historyType = contextOpts.historyType || 'browser';
  32. const history = createHistory({
  33. type: historyType,
  34. basename,
  35. ...contextOpts.historyOpts,
  36. });
  37. return (pluginManager.applyPlugins({
  38. key: 'render',
  39. type: ApplyPluginsType.compose,
  40. initialValue() {
  41. const context = {
  42. routes,
  43. routeComponents,
  44. pluginManager,
  45. rootElement: contextOpts.rootElement || document.getElementById('root'),
  46. publicPath,
  47. runtimePublicPath,
  48. history,
  49. historyType,
  50. basename,
  51. callback: contextOpts.callback,
  52. };
  53. const modifiedContext = pluginManager.applyPlugins({
  54. key: 'modifyClientRenderOpts',
  55. type: ApplyPluginsType.modify,
  56. initialValue: context,
  57. });
  58. return renderClient(modifiedContext);
  59. },
  60. }))();
  61. }
  62. render();
  63. window.g_umi = {
  64. version: '4.2.8',
  65. };