Skip to content

Commit

Permalink
Fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena committed Nov 7, 2021
1 parent a0a9d74 commit 99da7a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
10 changes: 5 additions & 5 deletions packages/docusaurus-module-type-aliases/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ declare module '@generated/site-metadata' {
import type {DocusaurusSiteMetadata} from '@docusaurus/types';

const siteMetadata: DocusaurusSiteMetadata;
export default siteMetadata;
export = siteMetadata;
}

declare module '@generated/registry' {
Expand All @@ -48,13 +48,13 @@ declare module '@generated/routes' {

declare module '@generated/routesChunkNames' {
const routesChunkNames: Record<string, Record<string, string>>;
export default routesChunkNames;
export = routesChunkNames;
}

declare module '@generated/globalData' {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const globalData: Record<string, any>;
export default globalData;
export = globalData;
}

declare module '@generated/i18n' {
Expand All @@ -64,12 +64,12 @@ declare module '@generated/i18n' {
currentLocale: string;
localeConfigs: Record<string, {label: string; direction: string}>;
};
export default i18n;
export = i18n;
}

declare module '@generated/codeTranslations' {
const codeTranslations: Record<string, string>;
export default codeTranslations;
export = codeTranslations;
}

declare module '@theme-original/*';
Expand Down
7 changes: 3 additions & 4 deletions packages/docusaurus-plugin-google-gtag/src/gtag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@
*/

import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';
import {usePluginData} from '@docusaurus/useGlobalData';
import globalData from '@generated/globalData';
import type {PluginOptions} from '@docusaurus/plugin-google-gtag';

export default (function () {
if (!ExecutionEnvironment.canUseDOM) {
return null;
}

const {trackingID} = usePluginData<PluginOptions>(
'docusaurus-plugin-google-gtag',
);
const {trackingID} = globalData['docusaurus-plugin-google-gtag']
.default as PluginOptions;

return {
onRouteUpdate({location}: {location: Location}) {
Expand Down

0 comments on commit 99da7a6

Please sign in to comment.