Skip to content

Commit

Permalink
fix: workaround for ssr failed since umi@4.0.53 (#1503)
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachScript committed Feb 23, 2023
1 parent 7026ff4 commit 5013565
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/features/derivative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,23 @@ export default (api: IApi) => {

// FIXME: skip prepare plugin since umi@4.0.48, because it is not compatible with dumi currently
if (api.isPluginEnable('prepare')) api.skipPlugins(['prepare']);

// skip routeProps plugin since umi@4.0.53
// because dumi support conventional route props by default and it will cause ssr failed
if (api.isPluginEnable('routeProps')) {
api.skipPlugins(['routeProps']);

// FIXME: write a empty routeProps file to avoid umi throw error, should be removed after umi fixed
api.onGenerateFiles({
// make sure before umi generate files
stage: -Infinity,
fn() {
api.writeTmpFile({
noPluginDir: true,
path: 'core/routeProps.js',
content: 'export default {}',
});
},
});
}
};

0 comments on commit 5013565

Please sign in to comment.