diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0f93470b4..96efb0cf7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -495,6 +495,9 @@ importers: react-dom: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) + rsbuild-plugin-google-analytics: + specifier: 1.0.3 + version: 1.0.3(@rsbuild/core@1.0.8) rspress: specifier: 1.31.1 version: 1.31.1(webpack@5.94.0) @@ -3691,6 +3694,14 @@ packages: typescript: optional: true + rsbuild-plugin-google-analytics@1.0.3: + resolution: {integrity: sha512-9AaubhqxiJ46yuBDkXtIjUnhMLUjGtMtRUeU9vkTrC4CfbJkHsHASwRJIRIxV7XMbr5Mwn/Ithh6lNh79RqehQ==} + peerDependencies: + '@rsbuild/core': 0.x || 1.x || ^1.0.1-beta.0 + peerDependenciesMeta: + '@rsbuild/core': + optional: true + rslog@1.2.3: resolution: {integrity: sha512-antALPJaKBRPBU1X2q9t085K4htWDOOv/K1qhTUk7h0l1ePU/KbDqKJn19eKP0dk7PqMioeA0+fu3gyPXCsXxQ==} engines: {node: '>=14.17.6'} @@ -8272,6 +8283,10 @@ snapshots: '@microsoft/api-extractor': 7.47.9(@types/node@18.19.39) typescript: 5.6.2 + rsbuild-plugin-google-analytics@1.0.3(@rsbuild/core@1.0.8): + optionalDependencies: + '@rsbuild/core': 1.0.8 + rslog@1.2.3: {} rspack-plugin-virtual-module@0.1.13: diff --git a/scripts/dictionary.txt b/scripts/dictionary.txt index 1186a9dd7..90596a6bd 100644 --- a/scripts/dictionary.txt +++ b/scripts/dictionary.txt @@ -8,6 +8,7 @@ brotli browserslistrc bundleless caniuse +CEHQ chunkhash Chunktmp cjsx diff --git a/website/package.json b/website/package.json index 88489f891..f6c18a282 100644 --- a/website/package.json +++ b/website/package.json @@ -17,6 +17,7 @@ "@types/react-dom": "^18.3.0", "react": "^18.3.1", "react-dom": "^18.3.1", + "rsbuild-plugin-google-analytics": "1.0.3", "rspress": "1.31.1", "rspress-plugin-font-open-sans": "1.0.0" } diff --git a/website/rspress.config.ts b/website/rspress.config.ts index 939f90333..a3720dadc 100644 --- a/website/rspress.config.ts +++ b/website/rspress.config.ts @@ -1,4 +1,5 @@ import path from 'node:path'; +import { pluginGoogleAnalytics } from 'rsbuild-plugin-google-analytics'; import { pluginFontOpenSans } from 'rspress-plugin-font-open-sans'; import { defineConfig } from 'rspress/config'; @@ -84,5 +85,6 @@ export default defineConfig({ '@zh': path.join(__dirname, 'docs/zh'), }, }, + plugins: [pluginGoogleAnalytics({ id: 'G-Q66CEHQ6JR' })], }, });