@docusaurus/preset-classic 0.0.0-4861 → 0.0.0-4864

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.js CHANGED
@@ -6,7 +6,6 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- const plugin_debug_1 = require("@docusaurus/plugin-debug");
10
9
  function makePluginConfig(source, options) {
11
10
  if (options) {
12
11
  return [require.resolve(source), options];
@@ -15,11 +14,10 @@ function makePluginConfig(source, options) {
15
14
  }
16
15
  function preset(context, opts = {}) {
17
16
  const { siteConfig } = context;
18
- const { themeConfig, baseUrl } = siteConfig;
17
+ const { themeConfig } = siteConfig;
19
18
  const { algolia } = themeConfig;
20
19
  const isProd = process.env.NODE_ENV === 'production';
21
- const { debug, docs, blog, pages, sitemap = {}, theme, googleAnalytics, gtag, ...rest } = opts;
22
- const isDebugEnabled = debug || (debug === undefined && !isProd);
20
+ const { debug, docs, blog, pages, sitemap, theme, googleAnalytics, gtag, ...rest } = opts;
23
21
  const themes = [];
24
22
  themes.push(makePluginConfig('@docusaurus/theme-classic', theme));
25
23
  if (algolia) {
@@ -44,17 +42,13 @@ function preset(context, opts = {}) {
44
42
  if (googleAnalytics) {
45
43
  plugins.push(makePluginConfig('@docusaurus/plugin-google-analytics', googleAnalytics));
46
44
  }
47
- if (isDebugEnabled) {
45
+ if (debug || (debug === undefined && !isProd)) {
48
46
  plugins.push(require.resolve('@docusaurus/plugin-debug'));
49
47
  }
50
48
  if (gtag) {
51
49
  plugins.push(makePluginConfig('@docusaurus/plugin-google-gtag', gtag));
52
50
  }
53
51
  if (isProd && sitemap !== false) {
54
- if (isDebugEnabled) {
55
- sitemap.ignorePatterns ?? (sitemap.ignorePatterns = []);
56
- sitemap.ignorePatterns.push(`${baseUrl}${plugin_debug_1.routeBasePath}/**`);
57
- }
58
52
  plugins.push(makePluginConfig('@docusaurus/plugin-sitemap', sitemap));
59
53
  }
60
54
  if (Object.keys(rest).length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/preset-classic",
3
- "version": "0.0.0-4861",
3
+ "version": "0.0.0-4864",
4
4
  "description": "Classic preset for Docusaurus.",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/preset-classic.d.ts",
@@ -18,17 +18,17 @@
18
18
  },
19
19
  "license": "MIT",
20
20
  "dependencies": {
21
- "@docusaurus/core": "0.0.0-4861",
22
- "@docusaurus/plugin-content-blog": "0.0.0-4861",
23
- "@docusaurus/plugin-content-docs": "0.0.0-4861",
24
- "@docusaurus/plugin-content-pages": "0.0.0-4861",
25
- "@docusaurus/plugin-debug": "0.0.0-4861",
26
- "@docusaurus/plugin-google-analytics": "0.0.0-4861",
27
- "@docusaurus/plugin-google-gtag": "0.0.0-4861",
28
- "@docusaurus/plugin-sitemap": "0.0.0-4861",
29
- "@docusaurus/theme-classic": "0.0.0-4861",
30
- "@docusaurus/theme-common": "0.0.0-4861",
31
- "@docusaurus/theme-search-algolia": "0.0.0-4861"
21
+ "@docusaurus/core": "0.0.0-4864",
22
+ "@docusaurus/plugin-content-blog": "0.0.0-4864",
23
+ "@docusaurus/plugin-content-docs": "0.0.0-4864",
24
+ "@docusaurus/plugin-content-pages": "0.0.0-4864",
25
+ "@docusaurus/plugin-debug": "0.0.0-4864",
26
+ "@docusaurus/plugin-google-analytics": "0.0.0-4864",
27
+ "@docusaurus/plugin-google-gtag": "0.0.0-4864",
28
+ "@docusaurus/plugin-sitemap": "0.0.0-4864",
29
+ "@docusaurus/theme-classic": "0.0.0-4864",
30
+ "@docusaurus/theme-common": "0.0.0-4864",
31
+ "@docusaurus/theme-search-algolia": "0.0.0-4864"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "react": "^16.8.4 || ^17.0.0",
@@ -37,5 +37,5 @@
37
37
  "engines": {
38
38
  "node": ">=14"
39
39
  },
40
- "gitHead": "98ec6aafe622a5101a4356e7ea9b30c441e3b977"
40
+ "gitHead": "ae6d7c8caecd661cd85ab05c9d7e9ecd935725a1"
41
41
  }
package/src/index.ts CHANGED
@@ -5,7 +5,6 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import {routeBasePath as debugPluginRouteBasePath} from '@docusaurus/plugin-debug';
9
8
  import type {
10
9
  Preset,
11
10
  LoadContext,
@@ -29,7 +28,7 @@ export default function preset(
29
28
  opts: Options = {},
30
29
  ): Preset {
31
30
  const {siteConfig} = context;
32
- const {themeConfig, baseUrl} = siteConfig;
31
+ const {themeConfig} = siteConfig;
33
32
  const {algolia} = themeConfig as Partial<ThemeConfig>;
34
33
  const isProd = process.env.NODE_ENV === 'production';
35
34
  const {
@@ -37,13 +36,12 @@ export default function preset(
37
36
  docs,
38
37
  blog,
39
38
  pages,
40
- sitemap = {},
39
+ sitemap,
41
40
  theme,
42
41
  googleAnalytics,
43
42
  gtag,
44
43
  ...rest
45
44
  } = opts;
46
- const isDebugEnabled = debug || (debug === undefined && !isProd);
47
45
 
48
46
  const themes: PluginConfig[] = [];
49
47
  themes.push(makePluginConfig('@docusaurus/theme-classic', theme));
@@ -76,17 +74,13 @@ export default function preset(
76
74
  makePluginConfig('@docusaurus/plugin-google-analytics', googleAnalytics),
77
75
  );
78
76
  }
79
- if (isDebugEnabled) {
77
+ if (debug || (debug === undefined && !isProd)) {
80
78
  plugins.push(require.resolve('@docusaurus/plugin-debug'));
81
79
  }
82
80
  if (gtag) {
83
81
  plugins.push(makePluginConfig('@docusaurus/plugin-google-gtag', gtag));
84
82
  }
85
83
  if (isProd && sitemap !== false) {
86
- if (isDebugEnabled) {
87
- sitemap.ignorePatterns ??= [];
88
- sitemap.ignorePatterns.push(`${baseUrl}${debugPluginRouteBasePath}/**`);
89
- }
90
84
  plugins.push(makePluginConfig('@docusaurus/plugin-sitemap', sitemap));
91
85
  }
92
86
  if (Object.keys(rest).length > 0) {