mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 08:49:51 +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
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue