Skip to content

Commit 95328a4

Browse files
authored
fix(docs): windows local dev (#4709)
1 parent 63f353b commit 95328a4

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

packages/cdk/src/docs-fe-stack.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,21 @@ export async function zipLocalBundle(zipFilePath: string): Promise<void> {
9393
throw new Error(`Local preview bundle not found at ${LOCAL_PREVIEW_BUNDLE_OUT_DIR}`);
9494
}
9595

96-
// Copy install-esbuild.js into the .next folder
97-
return fs.promises
98-
.copyFile(
99-
path.resolve(__dirname, "../utilities/install-esbuild.js"),
100-
path.join(LOCAL_PREVIEW_BUNDLE_OUT_DIR, "install-esbuild.js")
101-
)
102-
.then(() => {
103-
return zipFolder(LOCAL_PREVIEW_BUNDLE_OUT_DIR, zipFilePath);
104-
});
96+
// Copy install-esbuild.js and pnpm-workspace.yaml into the .next folder
97+
const installEsbuildPath = path.resolve(__dirname, "../utilities/install-esbuild.js");
98+
const pnpmWorkspacePath = path.resolve(__dirname, "../../../pnpm-workspace.yaml");
99+
100+
const LOCAL_PREVIEW_BUNDLE_STANDALONE_DIR = path.join(LOCAL_PREVIEW_BUNDLE_OUT_DIR, "standalone");
101+
if (fs.existsSync(LOCAL_PREVIEW_BUNDLE_STANDALONE_DIR)) {
102+
await fs.promises.copyFile(
103+
pnpmWorkspacePath,
104+
path.join(LOCAL_PREVIEW_BUNDLE_STANDALONE_DIR, "pnpm-workspace.yaml")
105+
);
106+
}
107+
108+
await fs.promises.copyFile(installEsbuildPath, path.join(LOCAL_PREVIEW_BUNDLE_OUT_DIR, "install-esbuild.js"));
109+
110+
return zipFolder(LOCAL_PREVIEW_BUNDLE_OUT_DIR, zipFilePath);
105111
}
106112

107113
export function resolveLocalPreviewBundleTarPath(zipFilePath?: string) {

0 commit comments

Comments
 (0)