From 7006e90a595bf5df70824d5a40bb38a29c664be7 Mon Sep 17 00:00:00 2001 From: Tay Zheng Yu <32449414+ZhengYuTay@users.noreply.github.com> Date: Mon, 8 Jun 2020 14:06:04 +0800 Subject: [PATCH] fix: resolve react-router to internal deps --- packages/runtime-react/src/bundler/config.ts | 6 +++++- yarn.lock | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/runtime-react/src/bundler/config.ts b/packages/runtime-react/src/bundler/config.ts index 13ed77888..893c6af82 100644 --- a/packages/runtime-react/src/bundler/config.ts +++ b/packages/runtime-react/src/bundler/config.ts @@ -34,7 +34,11 @@ export function config(api: IApi) { // config.externals(external); // make sure we don't have multiple entity of following packages , becasue module variable will fail config.resolve.alias.set('@shuvi/runtime-react', PACKAGE_DIR); - config.resolve.alias.set('react-router-dom$', resolveLocal('react-router-dom')); + config.resolve.alias.set( + 'react-router-dom$', + resolveLocal('react-router-dom') + ); + config.resolve.alias.set('react-router$', resolveLocal('react-router')); // WEBPACK5: using alias in webpack5 config.resolve.plugin('react-alias').use(AliasPlugin, [ diff --git a/yarn.lock b/yarn.lock index f1b03a04d..f65688f54 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1335,7 +1335,7 @@ globals "^11.1.0" lodash "^4.17.13" -"@babel/types@^7.0.0", "@babel/types@^7.10.1", "@babel/types@^7.3.0", "@babel/types@^7.4.4", "@babel/types@^7.7.0", "@babel/types@^7.7.2", "@babel/types@^7.7.4", "@babel/types@^7.8.3", "@babel/types@^7.8.6", "@babel/types@^7.9.0", "@babel/types@^7.9.5": +"@babel/types@7.10.1", "@babel/types@^7.0.0", "@babel/types@^7.10.1", "@babel/types@^7.3.0", "@babel/types@^7.4.4", "@babel/types@^7.7.0", "@babel/types@^7.7.2", "@babel/types@^7.7.4", "@babel/types@^7.8.3", "@babel/types@^7.8.6", "@babel/types@^7.9.0", "@babel/types@^7.9.5": version "7.10.1" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.10.1.tgz#6886724d31c8022160a7db895e6731ca33483921" integrity sha512-L2yqUOpf3tzlW9GVuipgLEcZxnO+96SzR6fjXMuxxNkIgFJ5+07mHCZ+HkHqaeZu8+3LKnNJJ1bKbjBETQAsrA==