umi-examples icon indicating copy to clipboard operation
umi-examples copied to clipboard

Windows平台下运行报错

Open astonishqft opened this issue 5 years ago • 0 comments

1 在windows平台下执行npm run dev会报错,看了下.umi下的umi.js文件: 2 生成的路径不能识别,应该是node中处理windows和linux的路径分隔符不同导致的。 暂时先将umi-plugin-entry.js插件里面的 api.modifyEntryRender(memo => { memo = const rootContainer = window.g_plugins.apply('rootContainer', { initialValue: React.createElement(require('${join(__dirname, "./redux/index")}').default, null, React.createElement(require('./router').default),), });替换成了相对路径:api.modifyEntryRender(memo => { memo = const rootContainer = window.g_plugins.apply('rootContainer', { initialValue: React.createElement(require("../../redux/index").default, null, React.createElement(require('./router').default),), });

astonishqft avatar May 06 '19 08:05 astonishqft