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