fix: use @docusaurus/react-loadable as package alias + include types (#5819)

This commit is contained in:
Sébastien Lorber 2021-10-29 11:04:07 +02:00 committed by GitHub
parent ab127e528d
commit 0b2d3483a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 8 additions and 59 deletions

View File

@ -80,7 +80,6 @@
"@types/react": "^17.0.2",
"@types/react-dev-utils": "^9.0.1",
"@types/react-helmet": "^6.0.0",
"@types/react-loadable": "^5.5.3",
"@types/react-router-config": "^5.0.1",
"@types/react-test-renderer": "^17.0.1",
"@types/semver": "^7.1.0",

View File

@ -14,7 +14,6 @@
"dependencies": {
"@types/react": "*",
"@types/react-helmet": "*",
"@types/react-loadable": "*",
"@types/react-router-config": "*",
"@types/react-router-dom": "*"
},

View File

@ -36,7 +36,6 @@
"@types/css-minimizer-webpack-plugin": "^3.0.2",
"@types/detect-port": "^1.3.0",
"@types/mini-css-extract-plugin": "^1.4.3",
"@types/module-alias": "^2.0.1",
"@types/nprogress": "^0.2.0",
"@types/react-dom": "^17.0.9",
"@types/rtl-detect": "^1.0.0",
@ -56,7 +55,7 @@
"@babel/runtime-corejs3": "^7.15.4",
"@babel/traverse": "^7.12.13",
"@docusaurus/cssnano-preset": "2.0.0-beta.8",
"@docusaurus/react-loadable": "5.5.0",
"@docusaurus/react-loadable": "5.5.2",
"@docusaurus/types": "2.0.0-beta.8",
"@docusaurus/utils": "2.0.0-beta.8",
"@docusaurus/utils-common": "2.0.0-beta.8",
@ -92,7 +91,6 @@
"leven": "^3.1.0",
"lodash": "^4.17.20",
"mini-css-extract-plugin": "^1.6.0",
"module-alias": "^2.2.2",
"nprogress": "^0.2.0",
"postcss": "^8.3.7",
"postcss-loader": "^6.1.1",
@ -100,7 +98,7 @@
"react-dev-utils": "12.0.0-next.47",
"react-error-overlay": "^6.0.9",
"react-helmet": "^6.1.0",
"react-loadable": "^5.5.0",
"react-loadable": "npm:@docusaurus/react-loadable@5.5.2",
"react-loadable-ssr-addon-v5-slorber": "^1.0.1",
"react-router": "^5.2.0",
"react-router-config": "^5.1.1",

View File

@ -39,7 +39,6 @@ Object {
"@theme/UserThemeComponent1": "src/theme/UserThemeComponent1.js",
"@theme/subfolder/PluginThemeComponent2": "pluginThemeFolder/subfolder/PluginThemeComponent2.js",
"@theme/subfolder/UserThemeComponent2": "src/theme/subfolder/UserThemeComponent2.js",
"react-loadable": "../../../../../../../@docusaurus/react-loadable",
}
`;

View File

@ -18,7 +18,6 @@ import {
getMinimizer,
} from './utils';
import {STATIC_DIR_NAME} from '../constants';
import SharedModuleAliases from './sharedModuleAliases';
import {loadPluginsThemeAliases} from '../server/themes';
import {md5Hash} from '@docusaurus/utils';
@ -149,8 +148,6 @@ export function createBaseConfig(
process.cwd(),
],
alias: {
...SharedModuleAliases,
'@site': siteDir,
'@generated': generatedFilesDir,

View File

@ -1,19 +0,0 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import moduleAlias from 'module-alias';
// The shared module aliases are module aliases that need to work in both SSR/NodeJS + Webpack
const SharedModuleAliases = {
// Useful to fix the react-loadable warning
// See https://github.com/jamiebuilds/react-loadable/pull/213#issuecomment-778246548
'react-loadable': '@docusaurus/react-loadable',
};
moduleAlias.addAliases(SharedModuleAliases);
export default SharedModuleAliases;

View File

@ -1327,11 +1327,12 @@
"@docsearch/css" "3.0.0-alpha.40"
algoliasearch "^4.0.0"
"@docusaurus/react-loadable@5.5.0":
version "5.5.0"
resolved "https://registry.yarnpkg.com/@docusaurus/react-loadable/-/react-loadable-5.5.0.tgz#6d6f0c8fd9a434b62a1ab1f8645ee7bde5a9ec21"
integrity sha512-Ld/kwUE6yATIOTLq3JCsWiTa/drisajwKqBQ2Rw6IcT+sFsKfYek8F2jSH8f68AT73xX97UehduZeCSlnuCBIg==
"@docusaurus/react-loadable@5.5.2", "react-loadable@npm:@docusaurus/react-loadable@5.5.2":
version "5.5.2"
resolved "https://registry.yarnpkg.com/@docusaurus/react-loadable/-/react-loadable-5.5.2.tgz#81aae0db81ecafbdaee3651f12804580868fa6ce"
integrity sha512-A3dYjdBGuy0IGT+wyLIGIKLRE+sAk1iNk0f1HjNDysO7u8lhL4N3VEm+FAubmJbAztn94F7MxBTPmnixbiyFdQ==
dependencies:
"@types/react" "*"
prop-types "^15.6.2"
"@docusaurus/responsive-loader@1.4.0":
@ -4306,11 +4307,6 @@
dependencies:
"@types/node" "*"
"@types/module-alias@^2.0.1":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@types/module-alias/-/module-alias-2.0.1.tgz#e5893236ce922152d57c5f3f978f764f4deeb45f"
integrity sha512-DN/CCT1HQG6HquBNJdLkvV+4v5l/oEuwOHUPLxI+Eub0NED+lk0YUfba04WGH90EINiUrNgClkNnwGmbICeWMQ==
"@types/node-fetch@^2.1.6":
version "2.5.12"
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.12.tgz#8a6f779b1d4e60b7a57fb6fd48d84fb545b9cc66"
@ -4431,14 +4427,6 @@
dependencies:
"@types/react" "*"
"@types/react-loadable@*", "@types/react-loadable@^5.5.3":
version "5.5.6"
resolved "https://registry.yarnpkg.com/@types/react-loadable/-/react-loadable-5.5.6.tgz#fcf6493d5015a4602672f3773a32032ce77fedea"
integrity sha512-2M7xH/wawZxNybbs/a76JkpUsMk4z6AxBh92cUtIBy2vK7EYYuitQbC4laY0hGz0e05R+mQ44YeHMtH2U+gMsw==
dependencies:
"@types/react" "*"
"@types/webpack" "^4"
"@types/react-router-config@*", "@types/react-router-config@^5.0.1":
version "5.0.3"
resolved "https://registry.yarnpkg.com/@types/react-router-config/-/react-router-config-5.0.3.tgz#72a53561bcb5e13b82c576527b818fa2579591c7"
@ -13894,11 +13882,6 @@ modify-values@^1.0.0:
resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022"
integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==
module-alias@^2.2.2:
version "2.2.2"
resolved "https://registry.yarnpkg.com/module-alias/-/module-alias-2.2.2.tgz#151cdcecc24e25739ff0aa6e51e1c5716974c0e0"
integrity sha512-A/78XjoX2EmNvppVWEhM2oGk3x4lLxnkEA4jTbaK97QKSDjkIoOsKQlfylt/d3kKKi596Qy3NP5XrXJ6fZIC9Q==
module-definition@^3.3.0, module-definition@^3.3.1:
version "3.3.1"
resolved "https://registry.yarnpkg.com/module-definition/-/module-definition-3.3.1.tgz#fedef71667713e36988b93d0626a4fe7b35aebfc"
@ -16308,7 +16291,7 @@ promzard@^0.3.0:
dependencies:
read "1"
prop-types@^15.0.0, prop-types@^15.5.0, prop-types@^15.5.8, prop-types@^15.6.2, prop-types@^15.7.2:
prop-types@^15.0.0, prop-types@^15.5.8, prop-types@^15.6.2, prop-types@^15.7.2:
version "15.7.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
@ -16679,13 +16662,6 @@ react-loadable-ssr-addon-v5-slorber@^1.0.1:
dependencies:
"@babel/runtime" "^7.10.3"
react-loadable@^5.5.0:
version "5.5.0"
resolved "https://registry.yarnpkg.com/react-loadable/-/react-loadable-5.5.0.tgz#582251679d3da86c32aae2c8e689c59f1196d8c4"
integrity sha512-C8Aui0ZpMd4KokxRdVAm2bQtI03k2RMRNzOB+IipV3yxFTSVICv7WoUr5L9ALB5BmKO1iHgZtWM8EvYG83otdg==
dependencies:
prop-types "^15.5.0"
react-router-config@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/react-router-config/-/react-router-config-5.1.1.tgz#0f4263d1a80c6b2dc7b9c1902c9526478194a988"