-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: workaround for ssr failed since [email protected] (#1503)
- Loading branch information
1 parent
7026ff4
commit 5013565
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -217,4 +217,23 @@ export default (api: IApi) => { | |
|
||
// FIXME: skip prepare plugin since [email protected], because it is not compatible with dumi currently | ||
if (api.isPluginEnable('prepare')) api.skipPlugins(['prepare']); | ||
|
||
// skip routeProps plugin since [email protected] | ||
// 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 {}', | ||
}); | ||
}, | ||
}); | ||
} | ||
}; |