@umijs/plugin-docs 4.6.0 → 4.6.2

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -4
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -84,9 +84,11 @@ var src_default = (api) => {
84
84
  }
85
85
  });
86
86
  api.modifyRoutes((r) => {
87
- if (!locales) return r;
87
+ if (!locales)
88
+ return r;
88
89
  for (const route in r) {
89
- if (r[route].path.match(/^[a-z]{2}-[A-Z]{2}\/.*/)) continue;
90
+ if (r[route].path.match(/^[a-z]{2}-[A-Z]{2}\/.*/))
91
+ continue;
90
92
  const defaultLangFile = r[route].file.replace(
91
93
  /(.[a-z]{2}-[A-Z]{2})?.md$/,
92
94
  ""
@@ -112,14 +114,14 @@ var src_default = (api) => {
112
114
  const themeConfigPath = (0, import_utils.winPath)((0, import_path.join)(api.cwd, "theme.config.ts"));
113
115
  const themeExists = (0, import_fs.existsSync)(themeConfigPath);
114
116
  let injectLocale = `themeConfig.locales = ${JSON.stringify(locales)};`;
115
- const [_, exports2] = (0, import_bundler_utils.parseModuleSync)({
117
+ const [_, exports] = (0, import_bundler_utils.parseModuleSync)({
116
118
  content: (0, import_fs.readFileSync)(theme, "utf-8"),
117
119
  path: theme
118
120
  });
119
121
  api.writeTmpFile({
120
122
  path: "index.ts",
121
123
  content: `
122
- export { ${exports2.filter((item) => !item.startsWith("$")).join(", ")} } from '${(0, import_utils.winPath)(
124
+ export { ${exports.filter((item) => !item.startsWith("$")).join(", ")} } from '${(0, import_utils.winPath)(
123
125
  require.resolve("../client/theme-doc/index.ts")
124
126
  )}';
125
127
  `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/plugin-docs",
3
- "version": "4.6.0",
3
+ "version": "4.6.2",
4
4
  "description": "@umijs/plugin-docs",
5
5
  "homepage": "https://github.com/umijs/umi/tree/master/packages/plugin-docs#readme",
6
6
  "bugs": "https://github.com/umijs/umi/issues",
@@ -33,7 +33,7 @@
33
33
  "rehype-slug": "5.0.1",
34
34
  "remark-gfm": "^3.0.1",
35
35
  "tailwindcss": "^3.2.4",
36
- "umi": "4.6.0"
36
+ "umi": "4.6.2"
37
37
  },
38
38
  "publishConfig": {
39
39
  "access": "public"