umijs / plugins

🍣 The one-stop shop for official Umi plugins and presets.
348 stars 238 forks source link

同时开启ssr和qiankun master模式, window is not defined #651

Open xuqianjin opened 3 years ago

xuqianjin commented 3 years ago
umi框架下同时开启ssr和qiankun master,报错

微信截图_20210709202510

import { defineConfig } from 'umi';

export default defineConfig({
  nodeModulesTransform: {
    type: 'none',
  },
  routes: [
    { path: '/', component: '@/pages/index' },
    {
      path: '/gamerun/*',
      component: '@/pages/test',
    },
  ],
  ssr: {},
  fastRefresh: {},
  qiankun: {
    master: {
      // 注册子应用信息
      apps: [
        {
          name: 'game', // 唯一 id
          entry: '//localhost:8001', // html entry
        },
      ],
    },
  },
});
"@umijs/plugin-qiankun": "^2.26.0",
"umi": "^3.5.5"
leeguooooo commented 2 years ago

找到解决方案了么?