mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 18:27:56 +02:00
refactor(v2): TS config update: reduce the size of npm modules (#4375)
* feat(v2): Reduce the size of the npm modules Signed-off-by: Reece Dunham <me@rdil.rocks> * Fix conflicts * Update search.js Co-authored-by: slorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
b99a4031c6
commit
76c0b11632
20 changed files with 45 additions and 22 deletions
|
@ -122,7 +122,8 @@
|
|||
"rimraf": "^3.0.2",
|
||||
"serve": "^11.3.2",
|
||||
"stylelint": "^13.10.0",
|
||||
"typescript": "^3.9.5"
|
||||
"tslib": "^2.1.0",
|
||||
"typescript": "^4.1.5"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,jsx,ts,tsx}": [
|
||||
|
|
|
@ -28,7 +28,8 @@
|
|||
"lodash": "^4.17.20",
|
||||
"prompts": "^2.4.0",
|
||||
"semver": "^7.3.4",
|
||||
"shelljs": "^0.8.4"
|
||||
"shelljs": "^0.8.4",
|
||||
"tslib": "^2.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.13.0"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
const toString = require('mdast-util-to-string');
|
||||
const visit = require('unist-util-visit');
|
||||
const {toValue} = require('../utils');
|
||||
const toValue = require('../utils').toValue;
|
||||
|
||||
/** @typedef {import('@docusaurus/types').TOCItem} TOC */
|
||||
/** @typedef {import('unist').Node} Node */
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
"remark-parse": "^8.0.2",
|
||||
"remark-stringify": "^8.1.0",
|
||||
"semver": "^7.3.4",
|
||||
"tslib": "^2.1.0",
|
||||
"unified": "^9.2.0",
|
||||
"unist-util-visit": "^2.0.2"
|
||||
},
|
||||
|
|
|
@ -26,7 +26,8 @@
|
|||
"fs-extra": "^9.1.0",
|
||||
"globby": "^11.0.2",
|
||||
"joi": "^17.4.0",
|
||||
"lodash": "^4.17.20"
|
||||
"lodash": "^4.17.20",
|
||||
"tslib": "^2.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.4 || ^17.0.0",
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
"lodash": "^4.17.20",
|
||||
"reading-time": "^1.3.0",
|
||||
"remark-admonitions": "^1.2.1",
|
||||
"tslib": "^2.1.0",
|
||||
"webpack": "^4.44.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
"lodash": "^4.17.20",
|
||||
"remark-admonitions": "^1.2.1",
|
||||
"shelljs": "^0.8.4",
|
||||
"tslib": "^2.1.0",
|
||||
"utility-types": "^3.10.0",
|
||||
"webpack": "^4.44.1"
|
||||
},
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
"minimatch": "^3.0.4",
|
||||
"remark-admonitions": "^1.2.1",
|
||||
"slash": "^3.0.0",
|
||||
"tslib": "^2.1.0",
|
||||
"webpack": "^4.44.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
@ -20,7 +20,8 @@
|
|||
"@docusaurus/core": "2.0.0-alpha.72",
|
||||
"@docusaurus/types": "2.0.0-alpha.72",
|
||||
"@docusaurus/utils": "2.0.0-alpha.72",
|
||||
"react-json-view": "^1.21.1"
|
||||
"react-json-view": "^1.21.1",
|
||||
"tslib": "^2.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.4 || ^17.0.0",
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
"@endiliey/responsive-loader": "^1.3.2",
|
||||
"react-waypoint": "^9.0.2",
|
||||
"sharp": "^0.27.1",
|
||||
"tslib": "^2.1.0",
|
||||
"webpack": "^4.44.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
"@docusaurus/utils": "2.0.0-alpha.72",
|
||||
"fs-extra": "^9.1.0",
|
||||
"joi": "^17.4.0",
|
||||
"sitemap": "^6.3.6"
|
||||
"sitemap": "^6.3.6",
|
||||
"tslib": "^2.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.4 || ^17.0.0",
|
||||
|
|
|
@ -21,7 +21,7 @@ const prismIncludeLanguages = (PrismObject: typeof PrismNamespace): void => {
|
|||
require(`prismjs/components/prism-${lang}`); // eslint-disable-line
|
||||
});
|
||||
|
||||
delete window.Prism;
|
||||
delete (window as Window & {Prism?: typeof PrismNamespace}).Prism;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
"@docusaurus/plugin-content-blog": "2.0.0-alpha.72",
|
||||
"@docusaurus/plugin-content-docs": "2.0.0-alpha.72",
|
||||
"@docusaurus/plugin-content-pages": "2.0.0-alpha.72",
|
||||
"@docusaurus/types": "2.0.0-alpha.72"
|
||||
"@docusaurus/types": "2.0.0-alpha.72",
|
||||
"tslib": "^2.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "2.0.0-alpha.72"
|
||||
|
|
|
@ -20,7 +20,8 @@
|
|||
"dependencies": {
|
||||
"@docusaurus/utils": "2.0.0-alpha.72",
|
||||
"chalk": "^4.1.0",
|
||||
"joi": "^17.4.0"
|
||||
"joi": "^17.4.0",
|
||||
"tslib": "^2.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.13.0"
|
||||
|
|
|
@ -25,7 +25,8 @@
|
|||
"fs-extra": "^9.1.0",
|
||||
"gray-matter": "^4.0.2",
|
||||
"lodash": "^4.17.20",
|
||||
"resolve-pathname": "^3.0.0"
|
||||
"resolve-pathname": "^3.0.0",
|
||||
"tslib": "^2.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.13.0"
|
||||
|
|
|
@ -107,6 +107,7 @@
|
|||
"shelljs": "^0.8.4",
|
||||
"std-env": "^2.2.1",
|
||||
"terser-webpack-plugin": "^4.1.0",
|
||||
"tslib": "^2.1.0",
|
||||
"update-notifier": "^5.1.0",
|
||||
"url-loader": "^4.1.1",
|
||||
"wait-on": "^5.2.1",
|
||||
|
|
|
@ -43,7 +43,7 @@ function linkPrefetchStrategy(url: string) {
|
|||
});
|
||||
}
|
||||
|
||||
function xhrPrefetchStrategy(url: string) {
|
||||
function xhrPrefetchStrategy(url: string): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const req = new XMLHttpRequest();
|
||||
req.open('GET', url, true);
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2017",
|
||||
"target": "ES2019",
|
||||
"module": "commonjs",
|
||||
"lib": ["es2017","es2019.array", "DOM"],
|
||||
"lib": ["ESNext", "DOM"],
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"declarationMap": false,
|
||||
"jsx": "react",
|
||||
|
||||
/* Strict Type-Checking Options */
|
||||
|
@ -30,7 +30,11 @@
|
|||
"esModuleInterop": true,
|
||||
|
||||
/* Advanced Options */
|
||||
"resolveJsonModule": true
|
||||
"resolveJsonModule": true,
|
||||
|
||||
/* Use tslib */
|
||||
"importHelpers": true,
|
||||
"noEmitHelpers": true,
|
||||
},
|
||||
"exclude": ["node_modules", "**/__tests__/**/*", "**/lib/**/*"]
|
||||
}
|
||||
|
|
|
@ -19834,11 +19834,16 @@ typedarray@^0.0.6:
|
|||
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
||||
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
|
||||
|
||||
typescript@^3.8.3, typescript@^3.9.5:
|
||||
typescript@^3.8.3:
|
||||
version "3.9.7"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa"
|
||||
integrity sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==
|
||||
|
||||
typescript@^4.1.5:
|
||||
version "4.2.3"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.3.tgz#39062d8019912d43726298f09493d598048c1ce3"
|
||||
integrity sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw==
|
||||
|
||||
ua-parser-js@^0.7.18:
|
||||
version "0.7.21"
|
||||
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.21.tgz#853cf9ce93f642f67174273cc34565ae6f308777"
|
||||
|
|
Loading…
Add table
Reference in a new issue