mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 16:59:06 +02:00
fix: fix a lot of declaration semantic errors (#7194)
This commit is contained in:
parent
b154318c28
commit
7f06857e46
8 changed files with 62 additions and 61 deletions
|
@ -145,7 +145,7 @@ async function buildLocale({
|
|||
new ReactLoadableSSRAddon({
|
||||
filename: clientManifestPath,
|
||||
}),
|
||||
].filter(Boolean),
|
||||
].filter(<T>(x: T | undefined | false): x is T => Boolean(x)),
|
||||
},
|
||||
);
|
||||
|
||||
|
|
|
@ -236,7 +236,7 @@ You can also set the deploymentBranch property in docusaurus.config.js .`);
|
|||
if (!cliOptions.skipBuild) {
|
||||
// Build site, then push to deploymentBranch branch of specified repo.
|
||||
try {
|
||||
await runDeploy(await build(siteDir, cliOptions, false));
|
||||
await build(siteDir, cliOptions, false).then(runDeploy);
|
||||
} catch (err) {
|
||||
logger.error('Deployment of the build output failed.');
|
||||
throw err;
|
||||
|
|
25
packages/docusaurus/src/deps.d.ts
vendored
25
packages/docusaurus/src/deps.d.ts
vendored
|
@ -8,6 +8,8 @@
|
|||
declare module 'remark-admonitions';
|
||||
|
||||
declare module 'react-loadable-ssr-addon-v5-slorber' {
|
||||
import type {WebpackPluginInstance, Compiler} from 'webpack';
|
||||
|
||||
type Asset = {
|
||||
file: string;
|
||||
hash: string;
|
||||
|
@ -26,15 +28,14 @@ declare module 'react-loadable-ssr-addon-v5-slorber' {
|
|||
modulesToBeLoaded: string[],
|
||||
): {js: Asset[]; css: Asset[]};
|
||||
|
||||
type ReactLoadableSSRAddon = {
|
||||
new (props: {filename: string});
|
||||
};
|
||||
|
||||
const plugin: ReactLoadableSSRAddon;
|
||||
export default plugin;
|
||||
export default class ReactLoadableSSRAddon implements WebpackPluginInstance {
|
||||
constructor(props: {filename: string});
|
||||
apply(compiler: Compiler): void;
|
||||
}
|
||||
}
|
||||
|
||||
declare module '@slorber/static-site-generator-webpack-plugin' {
|
||||
import type {WebpackPluginInstance, Compiler} from 'webpack';
|
||||
import type {HelmetServerState} from 'react-helmet-async';
|
||||
|
||||
export type Locals = {
|
||||
|
@ -53,18 +54,18 @@ declare module '@slorber/static-site-generator-webpack-plugin' {
|
|||
noIndex: boolean;
|
||||
};
|
||||
|
||||
type StaticSiteGeneratorPlugin = {
|
||||
new (props: {
|
||||
export default class StaticSiteGeneratorPlugin
|
||||
implements WebpackPluginInstance
|
||||
{
|
||||
constructor(props: {
|
||||
entry: string;
|
||||
locals: Locals;
|
||||
paths: string[];
|
||||
preferFoldersOutput?: boolean;
|
||||
globals: {[key: string]: unknown};
|
||||
});
|
||||
};
|
||||
|
||||
const plugin: StaticSiteGeneratorPlugin;
|
||||
export default plugin;
|
||||
apply(compiler: Compiler): void;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'webpack/lib/HotModuleReplacementPlugin' {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue