mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-29 22:47:52 +02:00
chore(website): add Rsdoctor plugin (#10418)
This commit is contained in:
parent
aba22afa18
commit
473d1442b8
5 changed files with 442 additions and 103 deletions
44
website/src/plugins/rsdoctor/RsdoctorPlugin.ts
Normal file
44
website/src/plugins/rsdoctor/RsdoctorPlugin.ts
Normal file
|
@ -0,0 +1,44 @@
|
|||
/**
|
||||
* 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 type {PluginConfig} from '@docusaurus/types';
|
||||
|
||||
async function createRsdoctorBundlerPlugin() {
|
||||
// TODO Shitty workaround to bypass lib typechecking
|
||||
// package does not work will with skipLibCheck false
|
||||
// eslint-disable-next-line
|
||||
const {RsdoctorWebpackMultiplePlugin} = require('@rsdoctor/webpack-plugin');
|
||||
|
||||
return new RsdoctorWebpackMultiplePlugin({
|
||||
disableTOSUpload: true,
|
||||
supports: {
|
||||
// https://rsdoctor.dev/config/options/options#generatetilegraph
|
||||
generateTileGraph: true,
|
||||
},
|
||||
linter: {
|
||||
rules: {
|
||||
'ecma-version-check': 'off',
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export default (async function RsdoctorPlugin() {
|
||||
if (!process.env.RSDOCTOR) {
|
||||
return null;
|
||||
}
|
||||
const plugin = await createRsdoctorBundlerPlugin();
|
||||
console.log('Rsdoctor plugin enabled');
|
||||
return {
|
||||
name: 'rsdoctor-plugin',
|
||||
configureWebpack: () => {
|
||||
return {
|
||||
plugins: [plugin],
|
||||
};
|
||||
},
|
||||
};
|
||||
} satisfies PluginConfig);
|
Loading…
Add table
Add a link
Reference in a new issue