Skip to content

Commit 2c3f566

Browse files
authored
chore: add root and ensure vm (#3692)
1 parent 990e167 commit 2c3f566

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

.changeset/neat-ties-exist.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@modern-js/plugin-module-doc': patch
3+
---
4+
5+
chore: add root and ensure vm path
6+
chore: 添加root和确认虚拟模块路径

packages/module/plugin-module-doc/src/features/lanchDoc.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export async function launchDoc({
4747
const modernDocConfig = mergeDocConfig(
4848
{
4949
doc: {
50+
root,
5051
title: json.name,
5152
lang: DEFAULT_LANG,
5253
builderConfig: {

packages/module/plugin-module-doc/src/runtimeModule.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default class RuntimeModulesPlugin {
2020
writeModule(path: string, content: string) {
2121
const normalizedPath = this.#normalizePath(path);
2222
this.staticModules[normalizedPath] = content;
23+
fs.ensureFileSync(normalizedPath);
2324
fs.writeFileSync(normalizedPath, content);
2425
}
2526

0 commit comments

Comments
 (0)