dumi 2.4.20 → 2.4.21

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.
@@ -73,19 +73,21 @@ import '${(0, import_plugin_utils.winPath)(md)}?watch=parent';
73
73
  ).join("\n")}
74
74
  import LoadingComponent from '@@/dumi/theme/loading';
75
75
  import React, { Suspense } from 'react';
76
- import { DumiPage, useTabMeta, useRouteMeta } from 'dumi';
77
-
78
- function DumiMarkdownInner() {
79
- const { texts: ${import_rehypeText.CONTENT_TEXTS_OBJ_NAME} } = use${isTabContent ? "TabMeta" : "RouteMeta"}();
80
-
81
- return ${ret.content};
82
- }
76
+ import { DumiPage } from 'dumi';
77
+ import { texts as ${import_rehypeText.CONTENT_TEXTS_OBJ_NAME} } from '${(0, import_plugin_utils.winPath)(
78
+ this.resourcePath
79
+ )}?type=text';
83
80
 
84
81
  // export named function for fastRefresh
85
82
  // ref: https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/main/docs/TROUBLESHOOTING.md#edits-always-lead-to-full-reload
86
83
  function DumiMarkdownContent() {
87
- // wrap suspense for catch async meta data
88
- return <${wrapper}><Suspense fallback={<LoadingComponent />}><DumiMarkdownInner /></Suspense></${wrapper}>;
84
+ return (
85
+ <${wrapper}>
86
+ <Suspense fallback={<LoadingComponent />}>
87
+ ${ret.content}
88
+ </Suspense>
89
+ </${wrapper}>
90
+ )
89
91
  }
90
92
 
91
93
  export default DumiMarkdownContent;`;
@@ -264,6 +266,8 @@ function emit(opts, ret) {
264
266
  const { demos, embeds } = ret.meta;
265
267
  embeds.forEach((file) => this.addDependency(file));
266
268
  getDemoSourceFiles(demos).forEach((file) => this.addDependency(file));
269
+ if (this.resourceQuery.includes("watch=parent"))
270
+ return null;
267
271
  switch (opts.mode) {
268
272
  case "demo":
269
273
  return emitDemo.call(this, opts, ret);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dumi",
3
- "version": "2.4.20",
3
+ "version": "2.4.21",
4
4
  "description": "📖 Documentation Generator of React Component",
5
5
  "keywords": [
6
6
  "generator",