@docusaurus/plugin-vercel-analytics 3.4.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +1 -1
- package/lib/index.js +5 -3
- package/package.json +7 -7
- package/src/index.ts +5 -4
package/lib/index.d.ts
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { LoadContext, Plugin } from '@docusaurus/types';
|
|
8
8
|
import type { PluginOptions, Options } from './options';
|
|
9
|
-
export default function pluginVercelAnalytics(context: LoadContext, options: PluginOptions): Plugin;
|
|
9
|
+
export default function pluginVercelAnalytics(context: LoadContext, options: PluginOptions): Plugin | null;
|
|
10
10
|
export { validateOptions } from './options';
|
|
11
11
|
export type { PluginOptions, Options };
|
package/lib/index.js
CHANGED
|
@@ -7,18 +7,20 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.validateOptions = void 0;
|
|
10
|
+
exports.default = pluginVercelAnalytics;
|
|
10
11
|
function pluginVercelAnalytics(context, options) {
|
|
11
|
-
|
|
12
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
12
15
|
return {
|
|
13
16
|
name: 'docusaurus-plugin-vercel-analytics',
|
|
14
17
|
getClientModules() {
|
|
15
|
-
return
|
|
18
|
+
return ['./analytics'];
|
|
16
19
|
},
|
|
17
20
|
contentLoaded({ actions }) {
|
|
18
21
|
actions.setGlobalData(options);
|
|
19
22
|
},
|
|
20
23
|
};
|
|
21
24
|
}
|
|
22
|
-
exports.default = pluginVercelAnalytics;
|
|
23
25
|
var options_1 = require("./options");
|
|
24
26
|
Object.defineProperty(exports, "validateOptions", { enumerable: true, get: function () { return options_1.validateOptions; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-vercel-analytics",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"description": "Global vercel analytics plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@docusaurus/core": "3.
|
|
22
|
-
"@docusaurus/logger": "3.
|
|
23
|
-
"@docusaurus/types": "3.
|
|
24
|
-
"@docusaurus/utils": "3.
|
|
25
|
-
"@docusaurus/utils-validation": "3.
|
|
21
|
+
"@docusaurus/core": "3.5.0",
|
|
22
|
+
"@docusaurus/logger": "3.5.0",
|
|
23
|
+
"@docusaurus/types": "3.5.0",
|
|
24
|
+
"@docusaurus/utils": "3.5.0",
|
|
25
|
+
"@docusaurus/utils-validation": "3.5.0",
|
|
26
26
|
"@vercel/analytics": "^1.1.1",
|
|
27
27
|
"tslib": "^2.6.0"
|
|
28
28
|
},
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">=18.0"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "cb5829f3c34b26d798b869e38ee25073488140bd"
|
|
37
37
|
}
|
package/src/index.ts
CHANGED
|
@@ -11,14 +11,15 @@ import type {PluginOptions, Options} from './options';
|
|
|
11
11
|
export default function pluginVercelAnalytics(
|
|
12
12
|
context: LoadContext,
|
|
13
13
|
options: PluginOptions,
|
|
14
|
-
): Plugin {
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
): Plugin | null {
|
|
15
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
17
18
|
return {
|
|
18
19
|
name: 'docusaurus-plugin-vercel-analytics',
|
|
19
20
|
|
|
20
21
|
getClientModules() {
|
|
21
|
-
return
|
|
22
|
+
return ['./analytics'];
|
|
22
23
|
},
|
|
23
24
|
|
|
24
25
|
contentLoaded({actions}) {
|