@@ -191,6 +191,10 @@ export const copyNextServerCode = async (ctx: PluginContext): Promise<void> => {
191191 * @returns
192192 */
193193async function recreateNodeModuleSymlinks ( src : string , dest : string , org ?: string ) : Promise < void > {
194+ if ( ! org ) {
195+ console . log ( 'recreateNodeModuleSymlinks' , { src, dest } )
196+ }
197+
194198 const dirents = await readdir ( join ( src , org || '' ) , { withFileTypes : true } )
195199
196200 await Promise . all (
@@ -207,14 +211,18 @@ async function recreateNodeModuleSymlinks(src: string, dest: string, org?: strin
207211 // the location where the symlink points to
208212 const symlinkTarget = await readlink ( join ( src , org || '' , dirent . name ) )
209213 const symlinkDest = join ( dest , org || '' , symlinkTarget )
214+
215+ console . log ( { symlinkSrc, symlinkTarget, symlinkDest } )
210216 // only copy over symlinks that are traced through the nft bundle
211217 // and don't exist in the destination node_modules
212218 if ( existsSync ( symlinkDest ) && ! existsSync ( symlinkSrc ) ) {
213219 if ( org ) {
214220 // if it is an organization folder let's create the folder first
215221 await mkdir ( join ( dest , org ) , { recursive : true } )
216222 }
217- await symlink ( symlinkTarget , symlinkSrc )
223+
224+ // await symlink(symlinkTarget, symlinkSrc)
225+ throw new Error ( '(just for testing) hitting recreateNodeModuleSymlinks case' )
218226 }
219227 }
220228 } ) ,
0 commit comments