diff --git a/packages/docusaurus/src/client/serverEntry.tsx b/packages/docusaurus/src/client/serverEntry.tsx index 2f14ecabd238..408bfee0e3dc 100644 --- a/packages/docusaurus/src/client/serverEntry.tsx +++ b/packages/docusaurus/src/client/serverEntry.tsx @@ -26,7 +26,6 @@ import logger from '@docusaurus/logger'; // eslint-disable-next-line no-restricted-imports import _ from 'lodash'; import type {Locals} from '@slorber/static-site-generator-webpack-plugin'; -import {DOCUSAURUS_VERSION} from '@docusaurus/utils'; const getCompiledSSRTemplate = _.memoize((template: string) => eta.compile(template.trim(), { @@ -72,6 +71,7 @@ async function doRender(locals: Locals & {path: string}) { baseUrl, ssrTemplate, noIndex, + DOCUSAURUS_VERSION, } = locals; const location = routesLocation[locals.path]!; await preload(location); diff --git a/packages/docusaurus/src/deps.d.ts b/packages/docusaurus/src/deps.d.ts index c2dc3ccd1fd4..06f478ca6330 100644 --- a/packages/docusaurus/src/deps.d.ts +++ b/packages/docusaurus/src/deps.d.ts @@ -52,6 +52,7 @@ declare module '@slorber/static-site-generator-webpack-plugin' { baseUrl: string; ssrTemplate: string; noIndex: boolean; + DOCUSAURUS_VERSION: string; }; export default class StaticSiteGeneratorPlugin diff --git a/packages/docusaurus/src/webpack/server.ts b/packages/docusaurus/src/webpack/server.ts index fa2472828ed4..c0aab9ed99d9 100644 --- a/packages/docusaurus/src/webpack/server.ts +++ b/packages/docusaurus/src/webpack/server.ts @@ -13,7 +13,11 @@ import type {Props} from '@docusaurus/types'; import {createBaseConfig} from './base'; import WaitPlugin from './plugins/WaitPlugin'; import LogPlugin from './plugins/LogPlugin'; -import {NODE_MAJOR_VERSION, NODE_MINOR_VERSION} from '@docusaurus/utils'; +import { + NODE_MAJOR_VERSION, + NODE_MINOR_VERSION, + DOCUSAURUS_VERSION, +} from '@docusaurus/utils'; import ssrDefaultTemplate from './templates/ssr.html.template'; // Forked for Docusaurus: https://github.com/slorber/static-site-generator-webpack-plugin @@ -78,6 +82,7 @@ export default async function createServerConfig({ onHeadTagsCollected, ssrTemplate: ssrTemplate ?? ssrDefaultTemplate, noIndex, + DOCUSAURUS_VERSION, }, paths: ssgPaths, preferFoldersOutput: trailingSlash,