File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff 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
107113export function resolveLocalPreviewBundleTarPath ( zipFilePath ?: string ) {
You can’t perform that action at this time.
0 commit comments